Question 48Asked in UGC NET Computer Science, June 2016 (Paper II & III, Selected Questions)

Which one of the following array represents a binary max-heap?

  1. A[26, 13, 17, 14, 11, 9, 15]
  2. B[26, 15, 14, 17, 11, 9, 13]
  3. C[26, 15, 17, 14, 11, 9, 13]
  4. D[26, 15, 13, 14, 11, 9, 17]
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

From UGC NET Computer Science PYQ, June 2016 (Paper II & III, Selected Questions)

This is question 48 of UGC NET Computer Science PYQ, June 2016 (Paper II & III, Selected Questions). See all questions of this paper with answers, or attempt the paper as a timed online test to get your score and all-India rank.