Back to Developer Roadmap

Non-tail recursion

src/data/roadmaps/computer-science/content/[email protected]

4.0955 B
Original Source

Non-tail recursion

Tail recursion is when a function can directly return the result of a recursive call - there are no outstanding operations, and there is no need for the call stack frame to be preserved. So it can be translated to a “goto with arguments”, and the stack usage will be constant.

In “non-tail recursion”, there are outstanding operations after the recursive call, and the stack frame cannot be nuked.

Visit the following resources to learn more: