Which of the following statements is true in the context of a Deque?
Which of the following statements is true in the context of a Deque?
Solution
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).
Related questions:
2026: 21 May Shift 1
2025: 21 May Shift 1
2026: 21 May Shift 1
2025: 13 May Shift 2