Collective recursion

From Conservapedia
Jump to: navigation, 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.