In: Computer Science
Insert the following data into an AVL tree and show the steps 10, 20, 30, 25, 40, 50, 35, 33, 37, 60, 38.
AVL tree is a balanced binary search tree where the difference between the left and the right subtree can not be more than absolute value of one that is ,{-1,0,1} which is called balanced factor.
If while inserting we get any imbalance we find that what kind of imbalance it is,by moving 2 steps from the imbalanced note(whose balanced factor is more than absolute value of 1), towards the newly inserted node.
There are 4 types of imbalance:
They can be solved by their respective rotation according to their names respectively.
hope it helps!!!!!!!!
Thanks....