Recursion: Difference between revisions
From CasGroup
Jump to navigationJump to search
No edit summary |
No edit summary |
||
| Line 1: | Line 1: | ||
'''Recursion''' is the repeated application of | '''Recursion''' is the repeated application of a recursive procedure or definition. A recursive process is a self-similar process in which objects are defined in terms of other objects of the same type. | ||
a recursive procedure or definition. | |||
A recursive process is a self-similar process | |||
in which objects are defined in terms of other | |||
objects of the same type. | |||
[[Iteration|Iteration]] is the | [[Iteration|Iteration]] is the analog of [[Recursion|recursion]], because [http://stackoverflow.com/questions/931762/can-every-recursion-be-converted-into-iteration every recursion be converted into an iteration]. Often a [http://stackoverflow.com/questions/159590/way-to-go-from-recursion-to-iteration recursive algorithm can be replaced by an iterative algorithm] by pushing the parameters that would normally be passed to the recursive function onto a stack. | ||
== Links == | == Links == | ||
Latest revision as of 15:00, 1 February 2012
Recursion is the repeated application of a recursive procedure or definition. A recursive process is a self-similar process in which objects are defined in terms of other objects of the same type.
Iteration is the analog of recursion, because every recursion be converted into an iteration. Often a recursive algorithm can be replaced by an iterative algorithm by pushing the parameters that would normally be passed to the recursive function onto a stack.