Algorithm: Once a problem has been defined precisely, a procedure or process must be designed to produce the required output from the given input. Since a computer is a machine that does not possess problem-solving judgmental capabilities, this procedure must be designed as a sequence of simple and unambiguous steps. Such a procedure is known as an algorithm.
The steps that comprise an algorithm must be organized in a logical, clear manner so that the program that implements this algorithm is similarly well structured. Number of steps in the algorithm should be finite, they should be executed in finite amount of time and they should give the desired output.
Algorithms are designed using three basic methods of control:
a) Sequential : Steps are performed in a strictly sequential manner, each step being executed exactly once.
b) Decision/Selection : One of several alternative actions is selected and executed.
c) Repetition : One or more steps is performed repeatedly. Any algorithm can be constructed using basic methods of control.