Data Structures19 sections · 729 units
Open in Course

Intro

The FIFO principle

A queue processes elements in the order they arrive. First in, first out. Think of a line at a coffee shop.

In this section, you'll learn queues, then their more powerful cousin: the deque (double-ended queue).

The highlight is the monotonic deque, which solves "sliding window maximum" in O(n)O(n). By the end, you'll handle problems that require efficient access to both the maximum and minimum over a sliding range.