Skip to content

Glossary: Algorithms Beyond the Basics

Sliding window

Also written: window, sliding windows, fixed-size window, variable window

A run of neighboring items that moves along a list one step at a time, updating its total by adding the item coming in and subtracting the one leaving, so each step is O(1). A fixed-size window always covers k items; a variable window grows on the right and shrinks on the left.

Where the book teaches it

Related terms

Two pointers