Question:

Which data structure follows the Last-In-First-Out (LIFO) principle?

Show Hint

A stack follows the LIFO principle, meaning the last element added is the first one to be removed.
Updated On: Jun 27, 2025
  • Queue
  • Stack
  • Linked List
  • Array
Hide Solution
collegedunia
Verified By Collegedunia

The Correct Option is B

Solution and Explanation

The Last-In-First-Out (LIFO) principle is used by stacks, where the last element added is the first one to be removed. A stack operates like a stack of plates, where you add and remove plates from the top.
- Queue (A) follows the First-In-First-Out (FIFO) principle, where the first element added is the first one removed.
- Linked List (C) is a linear data structure that does not inherently follow the LIFO or FIFO principle, as elements can be accessed in various ways.
- Array (D) is a data structure that holds elements in a fixed-size structure but does not inherently follow the LIFO or FIFO principle.
Thus, (B) Stack is the correct answer.
Was this answer helpful?
1
0