If a binary tree has 10 nodes then what is the height of the tree
Answers
Answered by
3
Hello here is your answer by Sujeet yaduvanshi ☝☝☝☝☝☝
2 is height of the tree
2 is height of the tree
Answered by
2
"The height of a tree is given by the formula n = 2^( h + 1 ) – 1 where n are the nodes and h is the height.
If you are looking for h then the max height is log2( n + 1 ) = log2( 2^( h + 1 ) ) this equals ceiling( log2( n + 1 ) - 1 ) = h
Hence, the height will be 2
"
Similar questions
Business Studies,
8 months ago
Chemistry,
8 months ago
Music,
8 months ago
History,
1 year ago
Biology,
1 year ago