Go to your University || Python Lab || DSA Lab || AI & Machine Learning Lab || Linux Lab || OOPs Lab || DBMS Lab || JAVA Lab ||| Free Online Tutorials ||| 
companies for Campus Placement || Logical Reasoning || Quantitative Aptitude || General English || Technical-MCQ and Interview Questions || HR Interview Questions

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 

Online Courses & Fee

  1. AI, ML & Deep Learning - INR 3000/- (80% OFF)
  2. Web development using python (Django) - INR 2000/- (80% OFF)

FREE Online Certification Courses or Tutorials

  1. Python Programming
  2. Machine Learning Using Python
  3. Linux/Unix
  4. Data Structures and Algorithms(DSA)
  5. Database Management System(DBMS)
  6. Object Oriented Programming(OOPs) using C++
  7. Java Programming
  8. C Programming

[[ CALL - 07976731765 ]]

Details

Study Resources

Related questions

  Realize your learning potential with courses starting at ₹ 420
 Placements:   List of companies | Logical Reasoning Questions | Quantitative Aptitude Questions | General English Questions | Technical-MCQ and Interview Questions
 Online Free Training:  MACHINE LEARNINGPython Programming | Database Management System(DBMS) | Object Oriented Programming(OOPs) using C++ | Data Structures and Algorithms(DSA) | Java Programming | Linux/Unix | C Programming
Exams: List of Exams After Graduation | List of Engineering Entrance Examinations (UG/PG) | JEE Main | JEE Advanced | GATE | IES | ISROList of PSUs
 Download Previous Year Papers For:  GATE | IES | RAJASTHAN TECHNICAL UNIVERSITY (RTU-Kota)RPSC Technical Exams | ISRO
 Goeduhub
About Us | Contact Us   Social::   |  | 
...