Also called Decrease-key, Increase-key, Change-key and Priority update.
fresh numbers
The test's questions that a run answers, asked again on new numbers whenever you like. The answer, its working and the reason for every other choice come from changing a number in a heap's own run on the numbers shown.
choose one
1question 1
The heap drawn was made by putting in 90, 36, 72, 46, 4, 89 and 41. Then 41 changes to 91. At which place does 91 stop?
the answer, and why
the answer is D
41 stands at place 3, over 89 and 72. 91 is bigger than both, so it swaps with the smaller, 72, down to place 7, which has no child.
if you chose another
AThat swaps with 89, the first child. A sink swaps with the smaller child, 72.
BThat leaves 91 over 89 and 72, both smaller than it.
CPlace 2 is not below place 3. Place 3's children are places 6 and 7.
Each list puts 11 to 17 into an empty heap, smallest first, then makes one change; 16->43 means change 16 to 43. Which list makes the most comparisons?
the answer, and why
the answer is C
With 11, 12, 13, 14, 15, 16, 17, 11->99, the heap makes 10 comparisons, the most of the four.