Skip to main contentSkip to solution

Which of the following is true in the context of Stack?

Solution

✅ Correct Option: 2

A stack follows the LIFO (Last In, First Out) principle. Insertion (push) and removal (pop) both happen only at one end, called the top, so the element entered last is the first to be removed.


Option 1: this describes a queue (FIFO), a common confusion with stack.

Option 3: removal from any position is not allowed in a stack; only the top element can be removed.

Option 4: a stack is a linear data structure, since elements are arranged in a sequence.

Keyboard Shortcuts

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