1

The operation of increase-key or decrease-key is for updating a key within a max- or min-heap, respectively.

Why doesn't a max-heap have a decrease-key operation, and a min-heap a increase-key operation?

Thanks.

1 Answer 1

2

This have been discussed before here. To sum up, these operations can easily be implemented in O(log(n)) but usually aren't provided because they have little interest from a pure algorithmic perspective.

On the contrary, decrease-key on a min heap have an existing O(1) implementation in a Fibonacci Heap and has an application, for example in a Dijkstra path-finding.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.