3 ms·
I'm doubtful that recursion would ever be more performant than iteration. Iteration with a stack gives you all the capability of recursion without the function
by Merad 7y ago
I'm doubtful that recursion would ever be more performant than iteration. Iteration with a stack gives you all the capability of recursion without the function call overhead. As others have said, the main advantage of recursion is ease of designing and understanding the solution.