Heaps: Find the Running Median

  • + 1 comment

    So, what's the time complexity of inserting a element to an array? Normally, it's O(N), because you need to move other elements, and binary search can not help with that. While a heap can do this in O(logN).