What is a deque?
Correct answer B. A queue that allows insertion and deletion at both ends
A double-ended queue, or deque, supports adding and removing at both the front and the back. It can therefore act as a stack or a queue. Python's collections.deque and C++ std::deque provide fast operations at both ends. Removing the highest-priority element describes a priority queue, and restricting deletion to the front is an ordinary queue.
Answer checked How we write and check questions
Discussion