Data Structures · Question 1 · Easy

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

  1. Queue
  2. Circular queue
  3. Stack
  4. Priority queue
Answer and explanation

Answer: C. Stack

Explanation: In a stack, the element pushed most recently is the first one popped, which is LIFO. Queues are FIFO, and a priority queue serves elements by priority.

Next: Starting with an empty stack, Kavya performs: push(5), push(8), push(3)…

Practise data structures

Try a fresh set of data structures questions with an explanation after every answer, free and without signing up: Data Structures practice. Or sit a full placement mock test.

More data structures questions

More technical & programming practice

Algorithms · Object-Oriented Programming · DBMS · SQL · Operating Systems · Computer Networks · Software Engineering · Cloud & DevOps

LogicWiz Exams home · All practice topics · Placement mock tests · Daily 10 challenge