edited by
1,196 views
1 votes
1 votes
Consider the tree T in which left subtree contains half of the maximum number of nodes possible in the avl tree of height 6 and right subtree contains one 3rd of the minimum number of nodes possible in Avl tree of height 6.What will be total number of nodes in T?

 

Edit:- I am getting 75.5 as answer.Now i am not sure whether to pick 75 ot 76
edited by

2 Answers

0 votes
0 votes
Number of nodes in left subtree=(2^n-1)/2 =(2^6-1)/2=63

Number of elements in right subtree= (minimum number of nodes in avl at height 6)/3=33/3=11

Total number of nodes =1(root)+63+11=75
0 votes
0 votes
maximum number of nodes (left side) with height(h)=2^(h)-1 = 63

Now the minimum number of nodes N(h)=N(h-1)+N(h-2)+1 , N(0)=1, N(1)=2

 After solving the equation you will get N(6)=33 but we will see in only right most so

right side =33*1/3 = 1½ = 5

so total nodes= 63+5+1 =69

Related questions

0 votes
0 votes
0 answers
1
Mayankprakash asked Nov 2, 2018
497 views
Please suggest how to learn AVL rotation in AVL trees and some good practice questions or link would be so much helpfulThanks
2 votes
2 votes
3 answers
2
learncp asked Jan 26, 2016
787 views
Insert the given values in the order in initially empty $\text{AVL}$ tree.$\text{34,21,10,27,24,43,15,6}$What is the value at the root of the tree$?$
3 votes
3 votes
1 answer
3
hrcule asked Jul 16, 2018
2,770 views
Let T be a binary search tree with n nodes and Sn be the average number of comparisons required for successful search and Un be the average number of comparison required ...
1 votes
1 votes
1 answer
4
kd..... asked Apr 13, 2019
793 views
here what to do first as FIZZA and IMRAN both are unbalanced than either to do RR rotation from FIZZA-IMRAN-NAVEEN or RL rotation from IMRAN-NAVEEN-LOVELY