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.
I am confused by this problem. As best as I understand, the idea of the min-heap is that it is supposed to efficiently erase the top (minimum) element, but it is not supposed to be efficient at erasing an arbitrary element. On the other hand, I looked at other people's solutions, and they all implemented it using a set, which is not strictly speaking, correct because it would handle dublicate numbers differently. Nevertheless, the solution using a set passes all tests. Am I missing anything here?
QHEAP1
You are viewing a single comment's thread. Return to all comments →
I am confused by this problem. As best as I understand, the idea of the min-heap is that it is supposed to efficiently erase the top (minimum) element, but it is not supposed to be efficient at erasing an arbitrary element. On the other hand, I looked at other people's solutions, and they all implemented it using a set, which is not strictly speaking, correct because it would handle dublicate numbers differently. Nevertheless, the solution using a set passes all tests. Am I missing anything here?