mpdn/radix-heap

Clarify ordering

Closed this issue · 3 comments

dbdr commented

The Readme says: "any value pushed onto the heap must be larger than or equal to the top key." However at usage I got a "thread 'main' panicked at 'Key must be lower or equal to current top key', /tmp/radix-heap/src/lib.rs:211:13"

Is there an inconsistency, or I am misunderstanding? I am just learning about radix heaps, so now I am doubly confused :D

mpdn commented

Definitely an inconsistency. The panic message is correct.

I originally designed this as a min-heap but changed it to a max-heap to match binary_heap, so that is probably where the mixup happened.

mpdn commented

New crate out with most of these mixups fixed. Post if you spot any other inconsistencies.

dbdr commented

Thanks a lot!