What is AVL tree ? 4 Basic Rotations(Left, Right, Left-Right, Right-Left) for Balancing with Diagram
Simple Snippets Simple Snippets
247K subscribers
57,470 views
1.1K

 Published On Nov 30, 2020

AVL tree is a self-balancing Binary Search Tree (BST) where the difference between heights of left and right subtrees cannot be more than one for all nodes. This difference is called the Balance Factor.
In order to perform this balancing, we perform ROTATIONs on the unbalanced/imbalanced Binary Search Tree to make it a AVL tree.
We peform 4 basic rotations depending of 4 difference cases -
1) Left Rotation
2) Right Rotation
3) Left Right Rotation
4) Right Left Rotation
---------------------------------------------------------------------------------------------
Theory & Code article - https://simplesnippets.tech/what-is-a...
Full Playlist - Full DSA playlist -    • Introduction to Data Structures & Alg...  
Full C++ Programming for Beginners Course -    • Introduction to Computer Programming ...  
---------------------------------------------------------------------------------------------
Support Simple Snippets by Donations -
Google Pay UPI ID - tanmaysakpal11@okicici
PayPal - paypal.me/tanmaysakpal11
---------------------------------------------------------------------------------------------
Timecodes -
00:00 Introduction
00:56 What is an AVL Tree
08:56 AVL Tree Rotations
11:02 Left Rotation
16:02 Right Rotation
18:03 Left Right Rotation
23:53 Right Left Rotation
26:36 When rotation is not needed
27:33 Why AVL is better
---------------------------------------------------------------------------------------------
Simple Snippets Official Website -
http://simplesnippets.tech/
Simple Snippets on Facebook -
  / simplesnippets  
Simple Snippets on Instagram -
  / simplesnippets  
Simple Snippets on Twitter -
  / simplesnippet  
Simple Snippets Google Plus Page -
https://plus.google.com/+SimpleSnippets
Simple Snippets email ID -
[email protected]

For More Technology News, Latest Updates and Blog articles visit our Official Website - http://simplesnippets.tech/
#avltree #binarytree #datastructures #binarysearchtree #bst

show more

Share/Embed