2 ms·
> Given that any recursive function can be written using a while loop with O(1) memory bounds I think that's only true if the function makes only one recursive
by cousin_it 15y ago
> Given that any recursive function can be written using a while loop with O(1) memory bounds
I think that's only true if the function makes only one recursive call, like computing the Fibonacci numbers. If the function calls itself recursively twice, it may end up using a lot of memory, e.g. the Ackermann function.