Skip to main contentSkip to solution

Stack works on the principle of :

Solution

✅ Correct Option: 2

A stack works on the Last In First Out (LIFO) principle. Both insertion (push) and deletion (pop) happen only at one end, called the top, so the element added most recently is the first one removed.


Option 1: this describes a deque (double-ended queue), not a stack.

Option 3: First In First Out (FIFO) is the principle of a queue.

Memory trick: a stack of plates, where you take the top plate (the last one placed) first.

Keyboard Shortcuts

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