...
Software-Engineering
December 1, 2023
Question 5143 – UGC NET CS 2018 JUNE Paper-2
December 1, 2023
Software-Engineering
December 1, 2023
Question 5143 – UGC NET CS 2018 JUNE Paper-2
December 1, 2023

Question 5142 – UGC NET CS 2018 JUNE Paper-2

Consider the array A=<4, 1, 3, 2, 16, 9, 10, 14, 8, 7>. After building heap from the array A, the depth of the heap and the right child of max-heap are__________ and __________ respectively. (Root is at level 0).

Correct Answer: B

Question 22 Explanation: 
A heap is a MAX-Heap if all the root nodes(parent nodes) have maximum value.
Step 1: Since a heap is a almost complete binary tree so build a heap first.

Step 2: Since the above heap is not a max heap so to convert a heap into max-heap start applying max- heapify operation from the largest index parent node(node having 1 or more children).



The above Heap is the max-heap where each root node have maximum value. Now depth of the Max-heap is 3 and right child of the Root node is 10.
A
3, 14
B
3, 10
C
4, 14
D
4, 10
0 0 votes
Article Rating
Subscribe
Notify of
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x
error: Alert: Content selection is disabled!!