Which one of the following array represents a binary max-heap?
Show answerHide answer
Correct answer: (C) [26, 15, 17, 14, 11, 9, 13]
Explanation
Properties of Max Heap: Must be complete binary tree. All levels are completely filled except possibly the last level. The last level is filled from Left to Right. Each parent node has a value greater than or equal to its children. Option (a) Not fulfill the property of Max Heap. Option (b) Not fulfill the property of Max Heap. Option (c) Fulfill the property of Max Heap. Option (d) Not fulfill the property of Max Heap. So, the correct option is (c). (xii) Divide and Conquer