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 heap sort's own run on the numbers shown.
choose one
1question 1
Heap sort starts on 15, 40, 22, 9, 31. What is the row once the heap is built, before the first swap of the top?
the answer, and why
the answer is C
Place 2 sifts first, and 40 is bigger than its children. Then 15 at the top swaps with 40, then with 31.
if you chose another
AThat stops the sift of 15 one round early. 31 is bigger, so 15 goes down again.
BThat is the end of the sort.
DThat is the start. 15 is smaller than its child 40.