News for hackers. Stuff that matters.
Re:Understanding Recursion as an Absolute Beginner by dreamcompiler on Friday September 06, 2019 @12:39AM (#20893123)
I don't know of,a case where it's more efficient, but tail recursion is exactly as efficient as iteration, because they compile to the same code. No stack is used and there's no function call overhead. But you need a compiler that knows how to compile tail calls.

There are no comments on this comment yet.