Bottom-up repair swaps fifteen with one hundred at indices six and thirteen, then fifty with one hundred at indices three and six, then eighty-nine with one hundred at indices one and three. The result [100,19,89,17,12,50,2,5,7,11,6,9,15] is a heap. One hundred must move to the root and its ancestor violations require these three corrections; the minimum is three, D.
More Binary Heaps questions
GATE 2021 CS (CS2) Q12– A binary min-heap of n elements is stored in an array. Find the worst-case complexity of…
GATE 2026 CS (CS1) Q23– Let n be an odd number greater than 100. Consider a binary minheap with n elements stored…
GATE 2025 CS (CS1) Q35– The height of any rooted tree is defined as the maximum number of edges in the path from…
GATE 2024 CS (CS1) Q41– An array [82, 101, 90, 11, 111, 75, 33, 131, 44, 93] is heapified. Which one of the…
GATE 2024 CS (CS1) Q43– Consider a binary min-heap containing 105 distinct elements. Let k be the index (in the…
GATE 2023 CS Q12– Which one of the following sequences when stored in an array at locations A[1],...,A[10]…