‹ Back to the paper
Question 4
1 mark
Computer ScienceISC Computer Science - Competency Focused Practice Questions (CISCE, August 2024)MCQRecursion
Choose the correct option.
Recursion takes toll on memory. Which of the following option is the reason for it?
- (a)Every recursive call is placed in a call stack memory.
- (b)Every recursive call is resolved in Last-In-First-Out (LIFO) manner.
- (c)Values of local variables are maintained until each of the calls are resolved.
- (d)All of the above.
Answer
Answer
Correct option: d
Answer: (d) All of the above.
Each recursive call is pushed onto the call stack (a), calls are resolved in LIFO order (b), and the local variables/parameters of each call must be kept until that call returns (c). All three together explain why recursion costs more memory than iteration.