What is an underflow condition?
What is an underflow condition?
Solution
✅ Correct Option: 1
Underflow occurs when an element is removed from a data structure that has nothing in it. In a stack, this means calling pop on an empty stack, since there is no top element to remove.
Option 4: this is overflow, which happens when pushing into a stack that has no space left.
Options 2 and 3: popping from a full stack and pushing into an empty stack are normal operations, so neither is an error condition.
Memory trick: underflow means "nothing left to take out" (pop on empty), overflow means "no room to put in" (push on full).
Related questions:
2026: 18 May Shift 2
2025: 15 May Shift 2