Consider the array a = <4,1,3,2,16,9,10,14,8,7>. After building hep from the arraya, the depth and right child of max heap are ___ and ___ respectively.
Answers
Answered by
0
Concept:
your answer is here
Max- heap: In max - heap, root node is always is greater than or equal to the other nodes of the tree.
Explanation:
A = <4, 1, 3, 2, 16, 9, 10, 14, 8, 7>.
STEP 1
Now, As 2 is greater than 1, there is need of rearrangement of nodes.
STEP 2:
Again exchange 16 with 2. Insert remaining nodes as per the property of max- heap.
STEP 3:
STEP 4:
STEP 5:
After inserting all the nodes in this way, final max - heap is:
As, root is at level 0, So, there are total 3 levels in this max - heap. Also, right child of root node is 10.
Step-by-step explanation:
i know it's help you mark me as brainliest
Similar questions