Open In App

UGC-NET | UGC NET CS 2016 July – III | Question 33

Which one of the following array represents a binary max-heap?
(A) [26, 13, 17, 14, 11, 9, 15]
(B) [26, 15, 14, 17, 11, 9, 13]
(C) [26, 15, 17, 14, 11, 9, 13]
(D) [26, 15, 13, 14, 11, 9, 17]

Answer: (C)
Explanation: For max heap we will compare parent node(i) with its left-child(2 * i) and right-child(2 * i + 1):

So, option (C) is correct.

Quiz of this Question

Article Tags :