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.
Well, you could just append and then sort the list after every step. Should work as well. It's slower of course, but not that horribly slow (as the list is nearly sorted at every step).
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Heaps: Find the Running Median
You are viewing a single comment's thread. Return to all comments →
Well, you could just append and then sort the list after every step. Should work as well. It's slower of course, but not that horribly slow (as the list is nearly sorted at every step).