How to Understand Computer Algorithms

How to Understand Computer Algorithms thumbnail
Understand Computer Algorithms

Computer algorithms are pieces of instructions that tell the machine to do a task. While they are written in many different programming languages, algorithms are easy enough to understand if you grasp the basic computer sciences topics in this article.

Instructions

    • 1

      Understand Computer Software and Hardware Basics - Computers operate on a system of 1's and 0's called binary. This method allows data storage and transfer to be done easily - using wires and electronic components as well as magnetic and optical media, such as Hard Drives and CD's. Binary math is different on the back end then regular math, but if you think of numbers that computers use as regular numbers, you don't have to worry about binary too much.

      Computers operate very quickly, performing millions of computations and data storage transfers per second! Modern-day programs are a set of many high-level instructions, that the computer translates into its own language to process.

    • 2

      Know Programming Basics - Programs are written in unique languages. There are hundreds of different languages, with translators (called compilers or interpreters) for the machines to understand and execute them. Most programming languages have the following basics:

      * variable - stores some type of data (number, string (text), etc) (C example: int i = 0)
      * function/subroutine - performs some sort of smaller task, can be "called" (used) multiple times in a program (C example: void functionName() {})
      * conditional - if/then - evaluates some value to decide if it is true, then executes different code based on whether it is true or not (C example: if, else)
      * loop - executes a set of code multiple times, based off a counter or conditional (C example: while, do)

      You should look up specifics for your programming language online.

    • 3

      Read the Algorithm Line-by-Line - Look at each step in the algorithm's process. It does not get any more complex than what is written. If the algorithm is written well, it should contain meaningful variable and function names, as well as comments from the programmer to help you understand it.

    • 4

      Try Paraphrasing or Writing Your Own Version - Sometimes it is helpful to try re-writing the algorithm in your own code, or in English. This is very hand for complicated algorithms with lots of variables or functions - try organizing a list of the different variables/functions on a separate sheet of paper/file to organize the process.

Related Searches:

Comments

You May Also Like

Related Ads

Featured