Find the Running Median

  • Asked to answer
    + 2 comments

    You are on a heap challenge! =P

    Try to determine how you can use heaps to solve the problem. Keeping all elements in a min heap would allow you to keep track of the smallest integer, whereas a max heap would let you keep track of the largest. How can you combine these ideas so you have easy access to the median element(s)?