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.
Simple algorithm. The idea is just to store the deleted values in a set or dict. And then when it comes to print the minimum, check if the current heap minimum has been deleted or not. If it has, deleted it from the heap and from the deleted set. If not, then, that's the min.
QHEAP1
You are viewing a single comment's thread. Return to all comments →
Simple algorithm. The idea is just to store the deleted values in a set or dict. And then when it comes to print the minimum, check if the current heap minimum has been deleted or not. If it has, deleted it from the heap and from the deleted set. If not, then, that's the min.