Question:

A data structure in which elements can be inserted or deleted at / from both ends but not in the middle is

Show Hint

The name "Dequeue" is a contraction of "Double-Ended Queue". This name itself tells you its main feature: it's a queue where you can operate on both ends.
  • Priority queue
  • Dequeue
  • Circular queue
  • Queue
Hide Solution
collegedunia
Verified By Collegedunia

The Correct Option is B

Solution and Explanation

Step 1: Analyze the properties of the described data structure. The key property is the ability to add and remove elements from \textit{both} the front and the back.
Step 2: Evaluate the options.

(A) Priority queue: Elements are removed based on priority, not position.
(B) Dequeue (Double-Ended Queue): This data structure is specifically designed to allow insertion and deletion at both ends. This matches the description.
(C) Circular queue: A standard queue implemented in a fixed-size array, where the back can wrap around to the front. It still follows the FIFO (First-In, First-Out) principle for insertion (at back) and deletion (at front).
(D) Queue: A standard queue follows FIFO. Elements are inserted at one end (rear) and deleted from the other end (front).
The data structure that allows operations at both ends is the Dequeue.
Was this answer helpful?
0
0