# Sliding Window vs Two Pointer

> The "sliding window" algorithm is a derivative of the general two pointer strategy. The difference with "sliding window" is that we are looking at not just the…

By Maxwell Kendall · 2022-08-05 · Tags: fundamentals
Source: https://www.maxwellkendall.com/blog/sliding-window-vs-two-pointer-sliding-window-vs-two-pointer

The "sliding window" algorithm is a derivative of the general two pointer strategy. The difference with "sliding window" is that we are looking at not just the two values at each index but a subset -- or, a "window" -- of the array on each iteration through the array. The window "slides" when the first index of the window changes.
