Avl Trees
Avl Trees
BY:-
CHARANPREET KAUR
AVL Tree
AVL tree is a self balanced binary search tree.
That means, an AVL tree is also a binary search tree but it is
a balanced tree.
A binary tree is said to be balanced, if the difference between
the heights of left and right subtrees of every node in the tree
is either -1, 0 or +1.
In other words, a binary tree is said to be balanced if for
every node, height of its children differ by at most one.
In an AVL tree, every node maintains a extra information
known as balance factor.
The AVL tree was introduced in the year of 1962 by G.M.
Adelson-Velsky and E.M. Landis.
Right and Left Skewed Binary
Search Tree
Balance factor of a node is the
difference between the heights of left
and right subtrees of that node.
The balance factor of a node is
RR ROTATION
RR ROTATION
Exercise—Do It yourself
Build an AVL tree with the following values:
15, 20, 24, 10, 13, 7, 30, 36, 25
Solution:
Deletion Operation in AVL Tree