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.
You are right, but also notice that this question asks you to remove an arbitrary element from the heap.
Pure heaps do not support the removal of arbitrary elements, as other users have pointed out.
So, in order to pass this challenge, I used a dictionary.
If the question asked us to write a pure heap (that does not support the removal of arbitrary elements), then there would be no need for the dictionary in the first place.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
QHEAP1
You are viewing a single comment's thread. Return to all comments →
You are right, but also notice that this question asks you to remove an arbitrary element from the heap.
Pure heaps do not support the removal of arbitrary elements, as other users have pointed out.
So, in order to pass this challenge, I used a dictionary.
If the question asked us to write a pure heap (that does not support the removal of arbitrary elements), then there would be no need for the dictionary in the first place.