Ans:- We can
find the third largest-value at:
- a child of the right child of the root
- a child of the left child of the root
- left or right child of the root
Explaination:-
A max heap is a type of data structure which is
based on complete binary tree. In the max heap, the value of the
parent node will be greater than or equal to the
value of it's child node. The
root node always contains the large element.
- Since, the root node always contains the large element
of heap, it never contains the third largest number.
- Since, the size of the heap is over 15 element, so, the
leaf node never contains the third largest element.
- Since, the child node is having smaller or equal value
in comparison to the parent node, it may be possible that the right
child or left child of the root may contains third largest
element.
- If the largest element occurs more than one time, then,
it is possible that "a child of the right child of
the root" or "a child of the left child of the root" may contains
the third largest element, since, the duplicate largest element
will be placed on the child of the root(left or
right).