Skip to content

Glossary: Algorithms Beyond the Basics in JavaScript

Sliding window

Also written: sliding windows, window

A run of neighboring items that moves along an array one step at a time, updating a running total by adding the new item and dropping the old one. It finds the best 7 days of sales in O(n).

Where the book teaches it

Related terms

Two pointersSlow and fast pointers