We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
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)?
Find the Running Median
You are viewing a single comment's thread. Return to all 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)?