Q
[Recursion]
Assertion (A): Recursion utilizes more memory as compared to iteration.
Reason (R): Absence of base case leads to infinite recursion.
Assertion (A): Recursion utilizes more memory as compared to iteration.
Reason (R): Absence of base case leads to infinite recursion.
Question Info
Choose the Best Option
Click any option to instantly check if you're correct.
Explanation
Assertion (A): Recursion utilizes more memory as compared to iteration.
Reason (R): Absence of base case leads to infinite recursion.
Step 1: Understanding the Assertion (A)
This statement is true.
In recursion:
- Each recursive call is stored in the call stack
- Memory is allocated for local variables and function states
- More recursive calls → more stack memory usage
Iteration generally uses less memory because loops do not create multiple stack frames.
Step 2: Understanding the Reason (R)
This statement is also true.
In recursion, a base case stops recursive calls.
This may finally cause:
- Stack Overflow Error
- Program crash
But Is R the Correct Explanation of A?
No.
The assertion says recursion uses more memory than iteration. This happens because:
- Each recursive call creates a new stack frame
- Function states and local variables are stored repeatedly
The reason talks about:
- Infinite recursion due to missing base case
Although true, it does not directly explain why recursion generally consumes more memory than iteration.
Important Difference:
| Concept | Description |
|---|---|
| More Memory Usage | Due to multiple recursive function calls stored in stack |
| Infinite Recursion | Happens when base case is missing |
Conclusion:
- Assertion (A) → True ✅
- Reason (R) → True ✅
- But R is NOT the correct explanation of A ❌
Share This Question
Challenge a friend or share with your study group.