4 ms·
The author says the opposite: "The non-recursive way is more efficient as the CLR does not have to keep pushing and popping its call stack (which is quite slow
by adyavanapalli 8y ago
The author says the opposite:
"The non-recursive way is more efficient as the CLR does not have to keep pushing and popping its call stack (which is quite slow). The non-recursive way is unfortunately harder to code. So the challenge was on!"
- Rizz 8y agoThat's what the tail call optimization is for, it optimizes the recursive function into a loop.