Reputation: 3064
According to http://en.wikipedia.org/wiki/Heap_%28data_structure%29#Comparison_of_theoretic_bounds_for_variants, it takes Θ(logn) (which translates to O(logn)) to perform the decrease-key operation. However, there seems to be no site that includes a binary heap implementation with a decrease-key operation.
Given therefore the lack of implementations on the web, is it possible to perform the decrease-key operation in a binary heap?
Upvotes: 17
Views: 5268
Reputation: 3064
I figured this out:
Upvotes: 12