AVL TREE

AVL TREE is pretty similar to binary search tree but AVL can adjust the balance of the tree automatically

The root of the node AVL tree is 0
The leaf of the right or leaf of the left is 1.
if the leaf is more than 1 the tree will automatically adjust the balance






The above picture is from the right node input and will be rotating to the left.





and this other picture is node from the left side and the rotation will be going to the right.



the correct solution of the wrong AVL tree is below:-



here another example :-



Example of Single rotation





below example of Doubly rotation




Comments

Popular posts from this blog

Pengertian kelas besar tentang head, curr, tail

Binary Search Tree(BNS)