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.
This is the cleanest code so far but can you explain printMin()...I think i followed but just for more clarity?
Tell me if i got this right --> If minimum element of pq is removed it becomes minimum of pqRemove, if second minimum element is removed it becomes second minimum in pqRemove. We can directly print if minimum wasnt deleted which is the while loop condition. right?
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 →
This is the cleanest code so far but can you explain printMin()...I think i followed but just for more clarity?
Tell me if i got this right --> If minimum element of pq is removed it becomes minimum of pqRemove, if second minimum element is removed it becomes second minimum in pqRemove. We can directly print if minimum wasnt deleted which is the while loop condition. right?