Skip to main contentSkip to solution

Solution

✅ Correct Option: 2

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


Option 1: FIFO (First In, First Out) is the principle of a queue, not a stack.

Option 3: Enqueue and dequeue are queue operations. A stack uses push and pop.

Option 4: LILO (Last In, Last Out) is just another name for FIFO, so it also describes a queue.

Keyboard Shortcuts

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