Online Courses
Free Tutorials  Go to Your University  Placement Preparation 
Goeduhub's Online Courses @ Udemy in Just INR 570/-
Online Training - Youtube Live Class Link
0 like 0 dislike
119 views

Goeduhub's Top Online Courses @Udemy

For Indian Students- INR 570/- || For International Students- $12.99/-

S.No.

Course Name

 Coupon

1.

Tensorflow 2 & Keras:Deep Learning & Artificial Intelligence

Apply Coupon

2.

Natural Language Processing-NLP with Deep Learning in Python Apply Coupon

3.

Computer Vision OpenCV Python | YOLO| Deep Learning in Colab Apply Coupon
    More Courses

1 Answer

1 like 0 dislike
by (124 points)

In Avl tree , generally there are two types of rotation.

1. Right Rotation 

2. Left Rotation 

Right Rotation: When balancing factor of node in a tree is more than +1 , we need to rotate tree in right direction. 

Algorithm: Right Rotation  [Rotation along node P]

Step 1. Begin 

Step 2. Set  q=p -> Left 

Step 3. Set hold = q -> Right 

Step 4. Set q -> right =p

Step 5. Set p -> Left = hold

Step 6. Return 

Left Rotation: When balancing factor  of a node is less than -1 , we need to rotate it in left direction. 

Algorithm: Left Rotation [Rotation along node P]

Step 1. Begin 

Step 2. Set 1 = p -> right 

Step 3. Set hold = q -> left 

Step 4. Set q -> left = p

Step 5. Set p -> right =hold 

Step 6. Return 

3.3k questions

7.1k answers

393 comments

4.5k users

Related questions

1 like 0 dislike
0 answers 79 views
1 like 0 dislike
1 answer 180 views
0 like 0 dislike
0 answers 71 views
1 like 0 dislike
1 answer 99 views

 Goeduhub:

About Us | Contact Us || Terms & Conditions | Privacy Policy || Youtube Channel || Telegram Channel © goeduhub.com Social::   |  | 
...