What Is The Sliding Window Algorithm?

Intro

The sliding window algorithm is very appropriately named.

The benefit of a sliding window is that you can let in as much sun/air as you want, by opening up the window as wide or narrow as you want.

Suppose you have a linear data structure, such as an array or a list, but are only interested in a subsection of it. For example, given an…