Also called Heapify, Floyd's method and Bottom-up heap construction.
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 building a heap's own run on the numbers shown.
choose one
1question 1
On which of these rows does building a heap make no swap at all?
the answer, and why
the answer is A
Every parent is at least as big as its children, 91 over 58 and 73, 58 over 12 and 44, 73 over 60 and 29. So every sift stops at once.
91, 58, 73, 12, 44, 60, 29 as a tree. Each marked parent is at least as big as its children.
if you chose another
B60 at place 5 is bigger than its parent, 58, so 58 swaps down.
C91 at place 2 is bigger than the top, 58, so 58 swaps down.
D60 at place 6 is bigger than its parent, 58, so 58 swaps down.