Yep Tail Call "Optimization" is nice. But what about recursive functions that cannot be tail call "optimized"?<p>First example that comes to mind is the Tower of Hanoi algorithm:<p><pre><code> def toh(ndisk, source, via, target):
if ndisk > 0:
toh(ndisk - 1, source, target, via)
target.append(source.pop())
toh(ndisk - 1, via, source, target)
</code></pre>
The function calls itself 2 times. Same thing is the fibonacci function which relies on the 2 previous results.<p>Here, you'll certainly need memoization and other techniques to not blow up the stack.