Iteration is the repetition of a process in order to generate a (possibly unbounded) sequence of outcomes. Each repetition of the process is a single iteration, and the outcome of each iteration is then the starting point of the next iteration. In mathematics and computer science, iteration (along with the related technique of recursion) is a standard element of algorithms. In mathematics, iteration may refer to the process of iterating a function, i.e. applying a function repeatedly, using the output from one iteration as the input to the next. Iteration of apparently simple functions can produce complex behaviors and difficult problems – for examples, see the Collatz conjecture and juggler sequences. Another use of iteration in mathematics is in iterative methods which are used to produce approximate numerical solutions to certain mathematical problems. Newton's method is an example of an iterative method. Manual calculation of a number's square root is a common use and a well-known example. In computing, iteration is the technique marking out of a block of statements within a computer program for a defined number of repetitions. That block of statements is said to be iterated; a computer scientist might also refer to that block of statements as an "iteration". Loops constitute the most common language constructs for performing iterations. The following pseudocode "iterates" three times the line of code between the curly brackets through a for loop, and uses the values of i as increments. a := 0 for i := 1 to 3 do { loop three times } begin a := a + i; { add the current value of i to a } end; print(a); { the number 6 is printed (0 + 1; 1 + 2; 3 + 3) } It is permissible, and often necessary, to use values from other parts of the program outside the bracketed block of statements, to perform the desired function. Iterators constitute alternative language constructs to loops, which ensure consistent iterations over specific data structures. They can eventually save time and effort in later coding attempts.

About this result
This page is automatically generated and may contain information that is not correct, complete, up-to-date, or relevant to your search query. The same applies to every other page on this website. Please make sure to verify the information with EPFL's official sources.
Related courses (3)
CS-450: Algorithms II
A first graduate course in algorithms, this course assumes minimal background, but moves rapidly. The objective is to learn the main techniques of algorithm analysis and design, while building a reper
CS-108: Practice of object-oriented programming
Les étudiants perfectionnent leurs connaissances en Java et les mettent en pratique en réalisant un projet de taille conséquente. Ils apprennent à utiliser et à mettre en œuvre les principaux types de
CIVIL-420: Dynamic analysis of structures
Être en mesure de déterminer les fréquences propres d'un système oscillant, ainsi que les efforts internes et les déplacements de ce système. Acquisition des connaissances pratiques du domaine à trave
Related MOOCs (5)
Matlab & octave for beginners
Premiers pas dans MATLAB et Octave avec un regard vers le calcul scientifique
Matlab & octave for beginners
Premiers pas dans MATLAB et Octave avec un regard vers le calcul scientifique
MATLAB and Octave for Beginners
Learn MATLAB and Octave and start experimenting with matrix manipulations, data visualizations, functions and mathematical computations.
Show more