← Quiz: Heaps and Heap Sort Internals: all 15 questions
Quiz: Heaps and Heap Sort Internals · Question 5 of 15
During sift down in a min-heap, the node is swapped with:
During sift down in a min-heap, the node is swapped with:
- A.the smaller of its two children, if that child is smaller than the node
- B.the left child always
- C.the larger of its two children
- D.its parent
Answer & explanation
Correct answer: the smaller of its two children, if that child is smaller than the node
Swapping with the smaller child makes that child a valid parent of the other one.
Can you get the rest right without peeking?
Take the timed Quiz: Heaps and Heap Sort Internals quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →