You are viewing a single comment's thread. Return to all comments →
but wait I don't get a few things-
1.my swim() function just swaps finds the min_pos and then swaps heap[min_pos] and heap[1]. wouldn't your swim() cost you extra swaps.
2.why did you search left tree first and then the right tree? why not just iterate through heap[1] to heap[last]?
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 →
but wait I don't get a few things-
1.my swim() function just swaps finds the min_pos and then swaps heap[min_pos] and heap[1]. wouldn't your swim() cost you extra swaps.
2.why did you search left tree first and then the right tree? why not just iterate through heap[1] to heap[last]?