While solving a geometry problem, I came across an approach called Sliding Window Algorithm.
Couldn’t really find any study material/details on it.
What is the algorithm about?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Generally speaking a sliding window is a sub-list that runs over an underlying collection. I.e., if you have an array like
a sliding window of size 3 would run over it like
This is useful if you for instance want to compute a running average, or if you want to create a set of all adjacent pairs etc.