Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why doesn't max-priority queue have DECREASE-KEY?

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?

like image 247
Qiang Li Avatar asked Nov 09 '11 19:11

Qiang Li


1 Answers

If you have a MAX-HEAP, DECREASE-KEY will be MAX-HEAPIFY in section 6.2 "Maintaining the heap property" of CLRS, 3rd edition.

like image 167
chill Avatar answered Sep 20 '22 14:09

chill