3 ms·
Odd choice to start with the iterative factorial before moving on to the recursive one. Usually it's the other way around, since the iterative algorithm is fast
by contravariant 10y ago
Odd choice to start with the iterative factorial before moving on to the recursive one. Usually it's the other way around, since the iterative algorithm is faster and uses less memory.
- mildbow 10y agoRecursive might be harder to grok to someone new because of the implied stack. However, once you understand the iterative version, it's probably easier to understand how the recursion is actually working.