4.2k views

The number of rotations required to insert a sequence of elements $9, 6, 5, 8, 7, 10$ into an empty $AVL$ tree is?

1. $0$
2. $1$
3. $2$
4. $3$
in DS | 4.2k views

Rotations are : LL LL RR

by Loyal (8.1k points)
selected
0

Last one should be RR, because node 6 got unbalanced just because of addition of 10 in the right subtree of right child of node 6.

0
Number of rotation = 3

Following are the roatation

1. LL

2 LL

3.RR
by Loyal (9.9k points)

1
2
3