Recursion Iteration
1. Recursion uses a selection structure
like 1. Iteration uses a
repetitive structure
if, if-else etc., like while, do-while etc.,
2. Recursion terminates when base
case is 2. Iteration
terminates when the loop
recognized Continuation condition fails
3. It can occur infinitely 3.
It can occur infinitely
4. Extra memory is required 4. Extra memory is not required
No comments:
Post a Comment