recategorized by
1,120 views
0 votes
0 votes
The height of a binary tree having 'i' nodes at level 'i' considering root to be at level 1 is ------. where 'n' is the total no of nodes in the tree.

A. O(logn)

B. O(n)

C. O(ROOT(N))

D. O(N2)
recategorized by

2 Answers

Best answer
1 votes
1 votes
No of nodes =n

N = summation of n from i=1to h

N= n² from 1to h

N= h² -1

√N+1= h

h=O(√N)
selected by

Related questions

1 votes
1 votes
0 answers
1
Rohit Gupta 8 asked Dec 25, 2017
1,141 views
If the average depth of a node in an $n$-node binary search tree is $O(\log{n})$, then the height of the tree is$O(n\log{n})$$O(n)$$O(\log{n})$$O(\sqrt(n\log{n}))$
4 votes
4 votes
1 answer
3
Shashank Chavan asked Jan 18, 2016
11,222 views
What's the difference between Binary tree height, level and depth? Sometimes it's confusing!Does there definition change according to question also, if mentioned?