2 ms·
They were referring to algorithms that need to use that much space either way and where the alternative is maintaining your own stack.
by furyofantares 3y ago
They were referring to algorithms that need to use that much space either way and where the alternative is maintaining your own stack.
- jcgrillo 3y agoEven in that case there's a tradeoff, if that stack needs to be large you can maintain it on the heap. Now you can do that to some extent with either a recursive implementation or not of course, but it's still a matter of deciding which is the better approach. It's not simply the case that "you can always just use recursion and it'll be totally fine mostly".