new_algos's blog

By new_algos, history, 22 months ago, In English

You are given an array of n integers. Your task is to calculate the median of each window of k elements, from left to right.

The median is the middle element when the elements are sorted. If the number of elements is even, there are two possible medians and we assume that the median is the smaller of them.

1≤k≤n≤2⋅105

1≤xi≤109

Read more »

 
 
 
 
  • Vote: I like it
  • +13
  • Vote: I do not like it