Redirected
recategorized by
579 views

2 Answers

1 votes
1 votes
5 nodes have max levels=5

n nodes have max level=n

 For binary tree max height = number of levels -1

so O(n) is correct.
0 votes
0 votes
The height of the binary tree in the worst case is O(N). We can calculate the the function g(x) in constant time C , therefore total cost is O(cN) or O(N)  in the worst case. This is O(logN) in the best case.

Related questions

1 votes
1 votes
2 answers
1
CHïntän ÞäTël asked Dec 10, 2018
977 views
four vertices {A,B,C,D} is given which has only vertex D as a leaf total number of binary tree are possible when every binary tree has four node!
0 votes
0 votes
1 answer
3
0 votes
0 votes
1 answer
4