Attributes of Algorithms

 
 

The minimal set of primitives needed in order to express any algorithm:

  1. Integer variables.
  2. Arithmetic.
  3. Ability to sequentially execute statements, which include assignment, selection (if), and iteration (i.e. looping: repeat).

 

Attributes we are interested with respect to algorithms:

An algorithm/(sub)program is correct if, for all possible inputs that satisfy its
preconditions, it terminates with an output that satisfies its postconditions.