The Gateway to Computer Science Excellence
First time here? Checkout the FAQ!
x
0 votes
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
asked in Others by Active (5.1k points)
retagged by | 288 views

1 Answer

+1 vote

Option (2) 3,10      

answered by Active (2.4k points)
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

Related questions



Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true

47,003 questions
51,322 answers
177,485 comments
66,666 users