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 89, 68, 47, 40, 87, 6 and 14. Then 14 changes to 81. At which place does 81 stop?
the answer, and why
the answer is D
14 stands at place 3, over 68 and 40. 81 is bigger than both, so it swaps with the smaller, 40, down to place 7, which has no child.
if you chose another
AThat swaps with 68, the first child. A sink swaps with the smaller child, 40.
BThat leaves 81 over 68 and 40, 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; 17->23 means change 17 to 23. Which list makes the most comparisons?
the answer, and why
the answer is D
With 11, 12, 13, 14, 15, 16, 17, 12->97, the heap makes 8 comparisons, the most of the four.