Skip to main contentSkip to solution

Which of the following condition will occur if one tries to delete an element from Empty STACK ?

Solution

✅ Correct Option: 2

Deleting (popping) from a stack that has no elements causes an UNDERFLOW condition. There is nothing at the top to remove, so the pop operation cannot be done.


Option 1: OVERFLOW is the opposite case, where an element is pushed onto a stack that is already full.

Option 4: this is a run-time condition, not a compile-time error, so the program still compiles.

Keyboard Shortcuts

  • Left arrow: Previous question
  • Right arrow: Next question
  • S key: Jump to solution
  • Q key: Jump to question