1,211 views
1 votes
1 votes
The height of a binary tree is defined as the number of nodes in the longest path form the root node to the leaf node. Let X be the height of complete binary tree with 256 nodes. The value of X will be ______.

1 Answer

Best answer
2 votes
2 votes

@Shaik Masthan Sir, Can we do like this 

number of nodes will be 1,2,4,8,... at each level

now count them it will be 2^n-1

now check for what value of n it will result in >=256

for n=8 it is 255

for n=9 it is >=256

so the height of the tree will be 9.

selected by

Related questions

2 votes
2 votes
3 answers
1
0 votes
0 votes
1 answer
2
Shankar Kakde asked Jan 10, 2019
255 views
–1 votes
–1 votes
1 answer
3
Shadan Karim asked Dec 31, 2018
273 views
When searching for a key value 50 in a BST, nodes containing key values 10,30,40,70,90,120.150.175 are traversed in any order . The number of different orders possible in...