Iteration (computing)

From Wiki @ Karl Jones dot com
Revision as of 14:09, 18 August 2016 by Karl Jones (Talk | contribs) (Created page with "In computing, '''iteration''' is the repetition of a block of statements within a computer program. == Description == Iteration can be used both as a general term, synon...")

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

In computing, iteration is the repetition of a block of statements within a computer program.

Description

Iteration can be used both as a general term, synonymous with repetition, and to describe a specific form of repetition with a mutable state.

Confusingly, it may also refer to any repetition stated using an explicit repetition structure, regardless of mutability.

When used in the first sense, recursion is an example of iteration, but typically using a recursive notation, which is typically not the case for iteration.

However, when used in the second (more restricted) sense, iteration describes the style of programming used in imperative programming languages.

This contrasts with recursion, which has a more declarative approach.

Used in the third sense, repetitions using while or for loops as well as those using map or fold functions may be considered iterations.

See also

External links