User:Andrew Dylan/sandbox

Algorithm
An algorithm is a step by step process for solving any problem. It is a set of rules showing how to solve a problem. Algorithms are written in simple English and they can be used in mathematical, computational and data processing fields.

Types of algorithm
Algorithms are classified in many ways based on their sequence of operations. Some of the algorithms are


 * Simple Recursive algorithms
 * Backtracking algorithms
 * Divide and conquer algorithms
 * Greedy algorithms
 * Branch and Bound algorithms
 * Brute force algorithms etc.,

Characteristics and qualities of algorithm

 * Algorithm should be written in sequence. (For example : step 1 and then step 2 and so on )
 * It should take input and produce output.
 * An algorithm should terminated at the end
 * An algorithm should provide accurate results after execution.
 * It should take lesser time to produce output and should consume less memory space in the computer memory.

Example : Algorithm to add two numbers
Step 1 : Start the program

Step 2 : Read number 1 and number 2

Step 3 : Add two numbers and store it in a variable sum   sum ← number 1 + number 2

Step 4 : Display sum

Step 5 : Stop the program