Skip to content

Glossary: Coding Interviews in C++

Sliding window

Also written: window

A run of neighboring items between `left` and `right` that moves along the list, keeping a running total by adding the item entering and subtracting the one leaving. It is O(n).

Where the book teaches it

Related terms

Two pointersPrefix sum