Need Help With This Problem

Revision en1, by new_algos, 2019-08-19 20:44:53

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

Tags treap, #data structure, #advance data structures, #implementation

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English new_algos 2019-08-19 20:44:53 364 Initial revision (published)