271 views
0 votes
0 votes

A weight-balanced tree is a binary tree in which for each node. The number of nodes in the left sub tree is at least half and at most twice the number of nodes in the right sub tree. The maximum possible height (number of nodes on the path from the root to the farthest leaf) of such a tree on n nodes is best described by which of the following?

a)\log_2 n           

 b) \log_{4/3} n                   

 c) \log_3 n                     

 d) \log_{3/2} n

1 Answer

0 votes
0 votes

answer will be floor(log2n) .

for example let us consider number of nodes(n)=1 then height=log 1=0

n=2 then h=1

n=3 then h=1

n=4 then h=2

and so on.

Related questions

0 votes
0 votes
2 answers
1
viral8702 asked Sep 21, 2023
285 views
The Total Combinations Possible of Min heap with 8 Distinct elements are ?
0 votes
0 votes
1 answer
2
iamdeepakji asked Jan 27, 2019
278 views
If there is negative edge cycle then dijkstra algorithm will give correct path or not same thing about bellman ford also?Bellman ford always halts or not?
0 votes
0 votes
1 answer
3
iamdeepakji asked Dec 27, 2018
402 views
Please solve this by taking some exampleBack edgecross edgetree edgeThankyou.