Sliding Window
The Sliding Window pattern is used to perform operations on a specific window size of an array or linked list, such as finding the longest subarray matching a condition.
Common Variants
- Fixed Window Size: Sliding window of constant width .
- Dynamic Window Size: Expanding the
rightboundary until conditions are violated, then shrinking theleftboundary.