Re:Thinking About Recursion
by iCodeSometime on Monday February 10, 2020 @05:48PM
(#22294256)
Alternatively, adding some kind of memoization can reduce run time and stack size pretty significantly for some algorithms.
e.g. if you're using recursion to compute fibonacci, you're re-computing quite a lot of steps by default
The short version of the tail call story is only one copy of the stack frame is kept, instead of all of the frames on the way down.