Algorithms

Deque

A queue where you can add and remove at both ends, the front and the rear. It can work as a stack and as a queue.

Example

With [A, B]: adding C at the front gives [C, A, B], and removing from the rear returns B.

Test yourself: Deque

Deques

A deque has ___ basic add and remove operations.

Lessons that use it

More algorithms terms

All terms →

Arki, the beaver mascot

Your next interview starts with 5 minutes today.

Free on iOS and Android. Start from zero, no account needed.