• + 2 comments

    By the way. isn't Binary Search Tree a better solution for this?

    Removing item from heap might take O(n) without optimization.