AlgoMaster Logo

Deque Interface

Last Updated: June 6, 2026

High Priority
13 min read

A Deque (pronounced "deck") is a double-ended queue, meaning elements can be added and removed from both the front and the back. That single property makes it a versatile tool for collection work: it can behave as a FIFO queue, as a LIFO stack, or as a sliding window over recent items. This lesson covers what Deque is, the full grid of methods it offers, how stack-style methods map onto it, why Deque (specifically ArrayDeque) is the modern replacement for the old Stack class, and the two implementations to use.

Premium Content

Subscribe to unlock full access to this content and more premium articles.