Content deleted Content added
→Early historical examples: By giving my name as headiy Tags: Mobile edit Mobile web edit |
m Reverted edits by 157.43.39.242 (talk) to last version by Ira Leviton |
||
Line 17:
== Early historical examples ==
Early examples of these algorithms are primarily decrease and conquer – the original problem is successively broken down into ''single'' subproblems, and indeed can be solved iteratively.
Line 66 ⟶ 65:
Stack overflow may be difficult to avoid when using recursive procedures, since many compilers assume that the recursion stack is a contiguous area of memory, and some allocate a fixed amount of space for it. Compilers may also save more information in the recursion stack than is strictly necessary, such as return address, unchanging parameters, and the internal variables of the procedure. Thus, the risk of stack overflow can be reduced by minimizing the parameters and internal variables of the recursive procedure or by using an explicit stack structure.
=== Choosing the base cases ===
In any recursive algorithm, there is considerable freedom in the choice of the ''base cases'', the small subproblems that are solved directly in order to terminate the recursion.
|