Multiple choice general knowledge science & technology

A data structure where elements can be added or removed at either end but not in the middle

  1. Queue

  2. Stack

  3. Deque

  4. none of the above

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

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.

AI explanation

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).