in Programming in C
666 views
2 votes
2 votes
Following keys are inserted into a binary search tree and AVL tree in given order,
keys : 45 30 8 36 60 51
The following nodes are added into corresponding BST and AVL tree then what is the difference in height of BST and AVL tree ?
Keys : 4 16 25 are added afterwards in the corresponding trees
in Programming in C
666 views

2 Answers

4 votes
4 votes

1 is answer.

edited by

1 comment

I think insertion of last node 25 leads to Left-Right case which requires Double rotation.

And Resultant AVL tree's root should be 45 only.

plz verify me!!
1
1
1 vote
1 vote

BST(h) - AVL(h)= 4-3=1

Follow below fig.