What is the difference between Recursion and Iteration?
A recursive function works through the process of calling itself until a condition is met.
e.g. While creating fibonacci series or
calculating multiple of a number
We simply call the function repeatedly.
Iteration uses a looping control structure (while, do while, for) to repeat a section of code until a condition is met.
Frankly, Anything done in one style of looping, can be done in the other.
Categories: General
A whole blog entry on loop theory – Simply Brilliant !
A recursive function required if condition to stop the program.
Iteration works till the condition is true.
Recursion is function call it self.
Iteration is one type of loop..
->two types of recursion
1)Primitive & 2) Non- primitive …
->types of iteration .
1)) loop 2) While loop 3) Do-while loop.
->>recursion is used to Stack (last in first out)
thz for d info……..
not a satisfactory answer……
Sanjana…this is the core difference between Recursion and Iteration.
If you have anything to add in it, feel free to post
Recursion is a type of iteration. In recursion a rule (mathematical expressions ) defines how to iterate e.g. fib series. You need to define exite criteria in recursion. Iteration is mutable (i= 0 to 5) control structure and finite length.
no stsfctry answr…guys…
simple 1 differnce its a basic differnce b/w these 2…
recrsn based on stack but itrtn not…