Stream: general

Topic: binary_heap From


gnzlbg (Nov 03 2018 at 13:55, on Zulip):

Do I need to sort a Vec before building a BinaryHeap from it ? Depending on whether I sort it or not, I appear to be getting two different BinaryHeaps.

rkruppe (Nov 03 2018 at 20:45, on Zulip):

what do you mean by "different BinaryHeaps"? there are many different ways to put the same set of elements into a binary heap, and all of them work the same with the heap interface (pop() removes elements in order), but e.g. iteration and Debug printing is arbitrary either way

gnzlbg (Nov 03 2018 at 20:55, on Zulip):

iteration and Debug printing is arbitrary either way

I was comparing them with debug printing -.-

Last update: Nov 21 2019 at 23:25UTC