Recursion: Difference between revisions

Content deleted Content added
added some information
No edit summary
Line 45:
Here is another, perhaps simpler way to understand recursive processes:
 
#Are we done yet? If so, return the results.<br>
#If not, ''simplify'' the problem and send it to 1.<br>
 
CommonA common method of the simplification is to divide the problem into subproblems. Such a programming technique is called ''divide-et-impera'' or ''divide and conquer'' and is a fundamental part of [[dynamic programming]].
 
Virtually all [[programming language|programming languages]] in use today allow the direct specification of recursive functions and procedures. When such a function is called, the computer keeps track of the various instances of the function by using a [[stack]]. Conversely, every recursive program can be transformed into an interative program by using a stack.