Home » Programming & Data Structure » Programming and data structure miscellaneous » Question

Programming and data structure miscellaneous

Programming & Data Structure

  1. Consider the following array of elements
    (89, 19, 50, 17, 12, 15, 2, 5, 7, 11, 6, 9, 100)
    The minimum number of interchanges needed to convert it into a max-heap is
    1. 4
    2. 5
    3. 2
    4. 3
Correct Option: D


1 st swap is : 100 and 15
2 nd swap is : 100 and 50
3 rd swap is : 100 and 89



Your comments will be displayed only after manual approval.