Skip to main contentSkip to solution

When the insertion and deletion of the elements are done only from the opposite ends of a dequeue, it is same as-

Solution

✅ Correct Option: 3

If insertion is done at one end (rear) and deletion at the opposite end (front), the first element inserted is the first one removed. This is FIFO order, which is exactly how a queue works.


Option 2: a stack uses the same end for both insertion and deletion (LIFO), so it needs the same end, not opposite ends.

Restricting a dequeue to one end for both operations gives a stack, and using opposite ends gives a queue.

Keyboard Shortcuts

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