‹ Back to the paper
Question 7(ii)
2 marks
Computer ScienceISC 2026 Computer Science Paper 1DifferentiateRecursion
Differentiate between the following.
State any two differences between iteration and recursion.
Answer
Answer
Two differences between iteration and recursion:
1. Execution mechanism: Iteration repeatedly executes a block of statements using looping constructs (for, while, do-while) until a condition is satisfied, whereas recursion repeatedly executes code by a method calling itself with a smaller problem until a base condition is reached.
2. Memory overhead: Iteration does not use additional call stack frames for each cycle (O(1) auxiliary stack space), whereas recursion allocates a new stack frame on the call stack for each call, consuming additional memory and carrying the risk of StackOverflowError if the recursion depth is too large.