new_algos's blog

By new_algos, history, 17 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.



Read more »

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