You get a bonus - 1 coin for daily activity. Now you have 1 coin

Double-Ended Queue (Deque)

Lecture



Double-ended queue (colloq. deque, from English deque — double ended queue; two-sided queue, a queue with two ends) — an abstract data type in which elements can be added and removed both at the beginning and at the end. It can be implemented using a doubly linked list.

Double-Ended Queue (Deque)

Typical operations

  • PushBack — add to the end of the queue.
  • PushFront — add to the front of the queue.
  • PopBack — remove from the end of the queue.
  • PopFront — remove from the front of the queue.
  • IsEmpty — check whether there are any elements.
  • Clear — clear the queue.

Application

A double-ended queue can be used to store browsing history: new websites are added to the end of the queue, and the oldest entries are removed when the history becomes too large. When the user asks to clear the browsing history for the last hour, the most recently added entries are removed.

See also

  • Stack
  • Queue
  • [[b4494]]

See also

created: 2024-08-20
updated: 2026-03-10
105



Was this answer useful?
Choose a quick rating so we can improve the next answer for you.
How satisfied are you?


Comments

To leave a comment

If you have any suggestion, idea, thanks or comment, feel free to write. We really value feedback and are glad to hear your opinion.
To reply

Lectures and tutorial on "Structures and data processing algorithms."

Terms: Structures and data processing algorithms.