recategorized by
5,180 views
2 votes
2 votes

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$
recategorized by

1 Answer

4 votes
4 votes
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$

Related questions

1 votes
1 votes
2 answers
1
makhdoom ghaya asked Sep 16, 2016
2,096 views
Which of the following expression is represented by the parse tree ?$(A + B) ^{*} C$$A + ^{*} BC$$A + B * C$$A * C + B$
1 votes
1 votes
2 answers
2
makhdoom ghaya asked Sep 15, 2016
4,609 views
In a $B$ tree of order $5$, the following keys are inserted as follows : $7, 8, 1, 4, 13, 20, 2, 6$ and $5$ How many elements are present in the root of the tree ?$1$ $2$...
0 votes
0 votes
3 answers
3
makhdoom ghaya asked Sep 15, 2016
2,241 views
A chained hash table has an array size of $100$. What is the maximum number of entries that can be placed in the table ?$100$$200$$10000$There is no upper limit
0 votes
0 votes
2 answers
4
makhdoom ghaya asked Sep 15, 2016
5,839 views
What is the most appropriate data structure to implement a priority queue ?HeapCircular arrayLinked listBinary tree