Which data structure efficiently supports both LIFO and FIFO operations under different constraints?

15 views
  • Deque (Correct Answer)
  • Stack
  • Queue
  • Linked List

Explanation

A deque (double-ended queue) allows insertion and deletion at both ends, enabling it to function as both a stack (LIFO) and a queue (FIFO). This flexibility makes it suitable for applications like sliding window algorithms and palindrome checking.

Comments (0)

No comments yet. Be the first to comment!

Want to practice more?

Explore thousands of MCQs across every exam category on Exams Nepal.

Find More MCQs