3 ms·
> This is why it can be considered memoization: each recursive call builds on the "stored" finished result of the previous call. Ok, but isn't this then also t
by misja111 9y ago
> This is why it can be considered memoization: each recursive call builds on the "stored" finished result of the previous call.
Ok, but isn't this then also the case for non-tail recursive calls? And ordinary recursive call builds just as well on the finished result of the previous call and no result is really "stored" in either case.
- ohkaiby 9y agoNo, if you look at vanderZwan's explanation for the non-tail recursive call, you'll see that it doesn't build on a finished result of the previous call. > You have to recurse until you reach n == 0, and only then does the whole sum "collapse".