A data structure where elements can be added or removed at either end but not in the middle
Reveal answer
Fill a bubble to check yourself
A data structure where elements can be added or removed at either end but not in the middle
Queue
Stack
Deque
none of the above
A deque (double-ended queue) allows insertion and deletion at both ends. A queue is restricted to one end for insertion and the other for removal (FIFO), while a stack operates LIFO (last-in-first-out) at a single end.
A deque (double-ended queue) is a data structure that allows insertion and removal of elements from both the front and the rear, but not from the middle. This distinguishes it from a plain queue (insert at one end, remove from the other only) and a stack (insert/remove from only one end, the top).