Computer Science, asked by parthu8475, 1 year ago

If a binary tree has 10 nodes then what is the height of the tree

Answers

Answered by Anonymous
3
Hello here is your answer by Sujeet yaduvanshi ☝☝☝☝☝☝

2 is height of the tree
Answered by aqibkincsem
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