Algorithm
Planning a program involves defining its logic ( the correct sequence of instructions needed to solve the problem at hand). The term algorithm is often used to refer to the logic of the program. It is a step by step description of how to arrive at the solution of the given problem. It may be formally defined as a sequence of instructions, designed in a manner that, if the instructions are executed in the specified sequence, the desired results will be obtained. In order to qualify as an algorithm , a sequence of instructions must possess the following characteristics :
-
Every step of an algorithm should perform a single task.
-
Each and every instruction should be precise and unambiguous.
-
Each instruction should be such that it can be performed in a finite time.
-
Simple statement and structures should be used in the development if the algorithm.
-
One or more instructions should not be repeated infinitely. This ensures that the algorithm will ultimately terminate.
-
After performing the instructions, that is, after the algorithm terminates, the desired results must be obtained.
-
An algorithm should have the capacity to handle some unexpected situations, which may arise during the solution of a problem (eg. Division by zero).
|
Last modified: Tuesday, 8 November 2011, 6:16 AM