in DS recategorized
3,363 views
1 vote
1 vote

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
in DS recategorized
3.4k views

1 comment

16,14,10,4,7,3,9,1,8,2 is the max heap formed and height is 3, right child is 10
0
0

3 Answers

2 votes
2 votes

Option (2) 3,10      

4 Comments

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
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
0
Thanks
0
0
1 vote
1 vote

Answer is (2). 3,10

This is max heap and right of root is 10.

The depth is no. of edge from root to given node so depth is 3

0 votes
0 votes

 

normally
Caption

option b) is correct

Related questions