3 ms·
> All recursive code can be rewritten to be non-recursive, you just keep track of your own stack data structure. This can be either not that much work, or a maj
by Something1234 11y ago
> All recursive code can be rewritten to be non-recursive, you just keep track of your own stack data structure. This can be either not that much work, or a major pain, depending on the exact problem.
Bull, a function that is not primitive recursive cannot be rewritten to be non recursive.
Sources:
https://en.wikipedia.org/wiki/Ackermann_function https://en.wikipedia.org/wiki/Ackermann_function
https://www.youtube.com/watch?v=i7sm9dzFtEI https://www.youtube.com/watch?v=i7sm9dzFtEI