In the discussion of heap data structure, for example in CLRS, the max-priority queue only needs INSERT, MAXIMUM, EXTRACT-MAX, and INCREASE-KEY. But why doesn't it also have DECREASE-KEY, at the least, its operation will also invalidate the heap property? Is it practically unimportant?
If you have a MAX-HEAP, DECREASE-KEY will be MAX-HEAPIFY in section 6.2 "Maintaining the heap property" of CLRS, 3rd edition.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With