arrow
arrow
arrow
A queue in which addition as well as deletion of elements can take place at both the ends is called
Question

A queue in which addition as well as deletion of elements can take place at both the ends is called

A.

Simple queue

B.

Circular queue

C.

Double-ended queue

D.

Priority queue

Correct option is C

A double-ended queue (deque) is a special type of linear data structure in which elements can be inserted and deleted from both the front and the rear ends. It generalizes the simple queue, where insertion is done at the rear and deletion at the front, by removing this restriction.

Important Key Points:

  1. A deque (double-ended queue) supports both enqueue and dequeue operations at both ends.
  2. It is useful in applications where flexible data insertion and deletion is needed (e.g., sliding window problems, task schedulers).
  3. Deques can be input-restricted or output-restricted, depending on whether insertion or deletion is restricted to one end.

Knowledge Booster:

  • Simple queue: Allows insertion at rear and deletion from front only; does not support operations at both ends.
  • Circular queue: A queue where the last position is connected back to the first to form a circle; insertion and deletion are still limited to rear and front respectively.
  • Priority queue: Elements are inserted based on priority; not position-based (front/rear) but priority-based insertion and removal.

Free Tests

Free
Must Attempt

Government Policies and Scheme

languageIcon English
  • pdpQsnIcon10 Questions
  • pdpsheetsIcon20 Marks
  • timerIcon5 Mins
languageIcon English
Free
Must Attempt

Government Schemes

languageIcon English
  • pdpQsnIcon10 Questions
  • pdpsheetsIcon20 Marks
  • timerIcon5 Mins
languageIcon English
Free
Must Attempt

SSC GD PYP (Held on 4 Feb 2025 S1)

languageIcon English
  • pdpQsnIcon80 Questions
  • pdpsheetsIcon160 Marks
  • timerIcon60 Mins
languageIcon English
TEST PRIME

Access ‘UPSSSC’ Mock Tests with

  • 60000+ Mocks and Previous Year Papers
  • Unlimited Re-Attempts
  • Personalised Report Card
  • 500% Refund on Final Selection
  • Largest Community
1 month
students-icon
368k+ students have already unlocked exclusive benefits with Test Prime!
Our Plans
Monthsup-arrow