Variable Size Sliding Window Format

General Format of Variable Size Sliding Window by Aditya Verma

start – i

end –j

window size : j-i +1


while(j<size)
{
some calculations involving j

 if(condition <k)
   j++;

  else if(cond. ==k)
  {
  ans=calculations
   j++;
  }
  else if( condition >k ){
      while(condition >k){
	remove calculation for i
	i++;
    }
      j++

   }

}
Edit this page on GitHub

Links to this note