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
On 98, 66, 82, 58, 39, 20, 7 every parent is at least as big as its children, so every sift stops at once and building makes no swap.
if you chose another
BBuilding a heap makes 1 swap on this row: a parent there is smaller than a child.
CBuilding a heap makes 1 swap on this row: a parent there is smaller than a child.
DBuilding a heap makes 1 swap on this row: a parent there is smaller than a child.