find out the array representation of given max heap if the value is 11 is inserted in it 14,12,10,8,6
Answers
Answer:
14,12,11,8,6,10
Explanation:
find out the array representation of given max heap if the value is 11 is inserted in it 14,12,10,8,6
14,12,11,8,6,10
Explanation:
The Array Representation Of Binary Heap is like
The Index of the root element is 0.
If i is the index of the node in the array.
Then, the other nodes related to the node are indexed in the array as − Left child : (2*i)+1.
Right child : (2*i)+2.
Parent-child : (i-1)/2.
A tree is max-heap if facts at each node withinside the tree are more than or identical to it is children' s facts.
Max heap facts shape is a specialised complete binary tree facts shape.
In a max heap nodes are organized primarily based totally on node fee. Max heap is a specialised complete binary tree wherein each figure node includes more or identical fees than its infant nodes.