288 views

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).

1. 3, 14
2. 3, 10
3. 4, 14
4. 4, 10
retagged | 288 views

+1 vote

Option (2) 3,10

0
How 10 is a right child? Shouldn't the right child be 9
+1
9 and 10 both are right children of the tree but according to the given options, we need to choose 10
0
Mam in the children we doesn't have any outgoing edge but 10 has an outgoing edge
0
10 is the right child with respect to the root.When we say a tree in which every node has 0 or 2 children, we consider not only the leaf nodes as the children but the internal nodes also.correct me if I am wrong
0
Mam internal node is not same as leaf node
0
Where did I mention that it's the same?
0
Can you please provide the resource from where you have studied that "a tree in which every node has 0 or 2 children, we consider not only the leaf nodes as the children but the internal nodes also" ?
0
In computer science, a binary tree is a tree data structure in which each node has at most two children, which are referred to as the left child and the right child.

https://en.m.wikipedia.org/wiki/Binary_tree
0
Thanks

1
2