Q21hard
When comparing Iteration (loops) to Recursion, which of the following is usually true regarding performance?
Topic-wise practice questions for Problem Solving & Analytical Skills. Test your knowledge, check solutions on demand, and pace your preparation.
function solve(n):
if n <= 1: return n
return n + solve(n - 2)
print(solve(5))