Skip to main contentSkip to solution

Which of the following operations performed on the stack are TRUE?

(A) PUSH adds a new element at the TOP of the stack.

(B) POP operation is used to remove the top most element of the stack.

(C) Trying to add an element to a full stack results in an exception called ‘underflow’.

(D) Trying to delete an element from an empty stack results in an exception called ‘underflow’.

Solution

✅ Correct Option: 1

PUSH inserts a new element at the TOP of the stack, and POP removes the topmost element, so (A) and (B) are true. Trying to delete from an empty stack gives an "underflow" exception, so (D) is true.


Option 2: (C) is false. Adding an element to a full stack causes "overflow", not underflow.

Memory trick: overflow = too many pushed (full stack), underflow = too many popped (empty stack).

Keyboard Shortcuts

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