Collective recursion

From Conservapedia
This is the current revision of Collective recursion as edited by EdBot (talk | contribs) at 21:28, April 1, 2008. This URL is a permanent link to this version of this page.
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Collective recursion is a special type of tail recursion, having results produced during the recursive calls with nothing returned.

One can optimize this type of recursion by executing the call in the current stack frame, rather than creating a new stack frame. Another way to optimize this type of recursion is by deallocating the entire recursion stack at once rather than a little at each return.