What Is The Sliding Window Algorithm?

janac
5 min readSep 29, 2020

Intro

The sliding window algorithm is very appropriately named.

A sliding window (GIF here)

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…

--

--

janac

Most of my writing is about software. I enjoy summarizing and analyzing books and self-help videos. I am senior software consultant at LazerTechnologies.com.