Algorithms and Data Structures · Middle · Question 17 of 75
What is the sliding window technique?
- ✓Correct answer: Moving the edges of a range while updating a summary
- 2Running the algorithm on random samples of the input
- 3Splitting the array into fixed blocks and sorting each one
Explanation
Instead of recomputing every subarray from scratch, the window adds the new element on the right and removes the old one on the left. Problems like "longest substring without repeating characters" become O(n).