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 37, 41, 25, 29, 57, 85 and 13. Then 25 changes to 94. At which place does 94 stop?
the answer, and why
the answer is A
25 stands at place 3, over 85 and 37. 94 is bigger than both, so it swaps with the smaller, 37, down to place 7, which has no child.
if you chose another
BThat swaps with 85, the first child. A sink swaps with the smaller child, 37.
CThat leaves 94 over 85 and 37, both smaller than it.
DPlace 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; 13->60 means change 13 to 60. Which list makes the most comparisons?
the answer, and why
the answer is B
With 11, 12, 13, 14, 15, 16, 17, 11->22, the heap makes 10 comparisons, the most of the four.