+1 vote
859 views

In a complete binary tree of n nodes, how far are the two most distant nodes ? Assume each edge in the path counts as !

1. About $\log_{2} n$
2. About $2 \log_{2} n$
3. About $n \log_{2} n$
4. About $2n$
in DS
recategorized | 859 views
0
why not 2$\log n$

+1 vote
If one node is present at extreme left side of the leaves and other node at the other extreme right side of the leaves ,then these two nodes have to cover up height 2 times .From extreme left to root and then from root to Extreme right .

Height of Binary tree$= \log_{2}n$

so Answer is $= \log_{2}n$ + $\log_{2}n$ =$2 \log_{2}n$
by Boss (15.9k points)
0
Yes, although no need to be in extreme corner. just need to be at the last layer.
0

Yep it makes sense for complete binary tree

0
@sourav,How wud the diagram for the above question will be drawn?
0

Distance between $H \rightarrow O$ or $I \rightarrow O$

+1
@sourav,Thanks. :)
+1

Devshree Dubey you are welcome!

+1 vote
1
+1 vote
2