Skip to main contentSkip to solution

Which of the following statements is true in the context of a Deque?

Solution

✅ Correct Option: 2

A Deque (double-ended queue) allows both insertion and deletion at the front end and at the rear end. This is why it can work as a queue or as a stack.


Option 1: a deque allows this, but it is only one of the four possible operations, so it does not describe a deque. An ordinary queue inserts at the rear and deletes from the front.

Options 3 and 4: using only one end for both insertion and deletion is how a stack behaves (LIFO), and a deque is not limited to this.

The two variants of a deque are the input-restricted deque (insertion at one end only) and the output-restricted deque (deletion at one end only).

Keyboard Shortcuts

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