|
|
|
|
|
by ZephyrP
1726 days ago
|
|
> Manifestly, recursion is never strictly necessary, and is furthermore almost always slower, or anyway no faster, than you could do maintaining state "by hand". Recursion is required in procedures like Ackermann's Function [1]. You can still simulate or write functions that avoid the syntactic fact that the procedure definition refers (either directly or indirectly) to itself, but you'll always be papering over the fact that it cannot be implemented with a fixed number of state variables. [1] https://en.wikipedia.org/wiki/Ackermann_function |
|
This is very untrue. While loop and a stack.
> cannot be implemented with a fixed number of state variables
Of course it can't, any function outside DSPACE(O(1)) can't. The fact that you have an implicit call stack doesn't change the space complexity.