Skip to main contentSkip to solution

In a dequeue, if insertion and deletion of elements is done from the opposite end, it will behave as ____________.

Solution

✅ Correct Option: 1

A deque allows insertion and deletion at both ends. If elements are inserted at one end (say the rear) and deleted from the opposite end (the front), the first element in is the first out. This is FIFO order, which is how a queue behaves.


Option 2: a stack needs insertion and deletion at the same end (LIFO), not opposite ends.

Options 3 and 4: list and array are general data structures with no fixed insertion/deletion order, so they are not what this end-to-end behaviour produces.

Keyboard Shortcuts

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