Heaps: Find the Running Median

  • + 1 comment

    I would suggest initializing the size of your list otherwise you don't really have constant time list insertion.

    Also I would change the class name since you implemented a sorted list solution rather than using heaps.

    I prefer this type of solution where you just sort the list as you intake the numbers and then more easily compute the median. Compared to the heap solution, the coding is much simpler, yet the run-time and space usage remain asymptotically the same.

    T: O(n log n) S: O(n)