Did you mean | Travel | Economics | Finance | Marketing | Business | Culture | Geography | History | Life | Mathematics | Science | Society | Technology | New site added |
Iteration is the repetition of a process, typically within a computer program. It can be used both as a general term, synonymous with repetition, and to describe a specific form of repetition with a mutable state. 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. Here an example of iteration, in imperative pseudocode:
var i, a := 0 // initialize a before iteration
for i from 1 to 3 { // loop three times
a := a + i // increment a by the current value of i
}
print a // the number 6 is printed
In this program fragment, the value of the variable i changes over time, taking the values 1, 2 and 3. This changing value—or mutable state—is characteristic of iteration. Iteration can be done in functional programming languages. The following example is in Scheme:
(define (sum n)
(define (iter n i)
(if (= n 0)
i
(iter (- n 1)(+ n i))
))
(iter n 1))
An iterator is an object that wraps iteration. See alsoWhat does Iteration mean ? Search with Google !Article on Iteration, category, different spelling or sense |
|
Did you mean: Culture | Geography | History | Life | Mathematics | Science | Society | Technology Economy finance business money economy: Economics | Finance | Marketing | Business | Money | Real Estate | Insurance | Retirement | Microeconomics | Economics Top Search: Kazaa | Sex | Pornography | Games | MySpace | Google | Ebay | Paris Hilton | Carmen Electra | Jessica Simpson | Eminem | MapQuest | Dogs | Jokes | Obituaries | MSN Messenger | Splogs | Ringtones | Casino | Poker | Gambling | Lyrics | Anime | Continents and countries in the world: Japan | United Kingdom | Canada | France | Amsterdam | Monaco | Spain | Capitals Cities | Continents | World | Americas | North America | South America | Europe | Africa | Eurasia | Oceania | Antarctica | Asia | Australia A web travel guide for your holidays, hotel and plane tickets: Travel guide and holidays French Version, guide de voyage dans le monde: Voyage et vacances Visit partners of Did you mean Travel: Partners Site Map articles begining from 0 to 9 and A to Z: Site Map 0 to A | Site Map B to C | Site Map D to Z Cours d'anglais, cours de langues pour debutant: Cours d'anglais Annuaire france regions et tourisme: Annuaire OuiX Sexe sur AbSexe, videos porno et annuaire sexe: Ab Sexe Url Rewriting by Atuvu Referencement This work is licensed under a GNU Free Documentation License. Texts derived from WikiPedia Iteration ©2006 Did you mean Copyright Notice Page Iteration cached on Friday 05th of September 2008 06:39:53 AM |