<DS/>DS_VISUALIZER
FoundationsOOPArraysLinked ListStacksQueuesTreesGraphsHashingStrings
exploreExplore
homechevron_rightTopicschevron_rightQueueschevron_rightDeque
sync_alt

QUEUES · DEQUE

Deque

Double-ended: insert and delete at both the front and the rear.

Choose an operation

first_pagearrow_outward

Insert Front

The op a plain queue forbids.

O(1)O(1)◍ 0/6
last_pagearrow_outward

Insert Rear

Same as a normal enqueue.

O(1)O(1)◍ 0/6
backspacearrow_outward

Delete Front

Same as a normal dequeue.

O(1)O(1)◍ 0/6
cancelarrow_outward

Delete Rear

Remove from the back — deque only.

O(1)O(1)◍ 0/6