This section contains 618 words (approx. 3 pages at 300 words per page) |
Iteration is a tool used in a procedural language, such as Basic, Pascal, C or Modula-2, whereby a repetition of a sequence of instructions is carried out that yield results successively closer to a desired result, the termination condition. There are three main character traits of iteration in programming: a defined set of initial conditions, an iterative step, and a defined set of termination conditions. Iteration is comparable to recursion which is a tool used in functional programming languages.
Recursion and iteration are very similar tools in that both have the same three basic characteristic traits: an initial set of conditions, a step that is repeated, and a termination condition or base case. The termination condition using iteration can either be a specified number of times a sequence of computer instructions is carried out or it can be a predefined condition that needs to be met. The main...
This section contains 618 words (approx. 3 pages at 300 words per page) |