What are Algorithms?

Definition:

Algorithm is a step-by-step procedure, which defines a set of instructions to be executed in a certain order to get the desired output.

Characteristics of an Algorithm

  1. Input: An Algorithm can have 0 or more well defined inputs.
  2. Output: An algorithm should have 1 or more well-defined outputs and should match the desired output.
  3. Definiteness / Unambiguous: Algorithm should be clear and unambiguous. Each of its steps (or phases), and their inputs/outputs should be clear and must lead to only one meaning.
  4. Effectiveness / Feasible: Should be feasible with the available resources.
  5. Finiteness: Algorithms must terminate after a finite number of steps.
  6. Independent: An algorithm should have step-by-step directions, which should be independent of any programming code.

There are no special syntax for writing Algorithms –

  • The most ideal way is writing in plain English so that even a lay man can understand and follow the flow of execution logic.
  • Programmers often use a pseudo C or Basic style to write down the steps, but one must always free it from complicated syntaxes that language offers.