Algorithm

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 :

  1. Every step of an algorithm should perform a single task.
  2. Each and every instruction should be precise and unambiguous.
  3. Each instruction should be such that it can be performed in a finite time.
  4. Simple statement and structures should be used in the development if the algorithm.
  5. One or more instructions should not be repeated infinitely. This ensures that the algorithm will ultimately terminate.
  6. After performing the instructions, that is, after the algorithm terminates, the desired results must be obtained.
  7. 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