Introduction:
AVL Tree is a Binary tree,which have minimum depth.
It can be used to balance the depth of any tree.
Balance Factor is used to measure the balance of tree.
Balance Factor =Depth of left tree-Depth of right tree.
Each node having 0 or 1 balance factor,not more than 1.
There are two Rotations which are used to Balance the given tree,which are
1. Single Rotation
2. Doubly Rotation
For example:
Single Rotation:-
Doubly Rotation:-
AVL Tree is a Binary tree,which have minimum depth.
It can be used to balance the depth of any tree.
Balance Factor is used to measure the balance of tree.
Balance Factor =Depth of left tree-Depth of right tree.
Each node having 0 or 1 balance factor,not more than 1.
There are two Rotations which are used to Balance the given tree,which are
1. Single Rotation
2. Doubly Rotation
For example:
Single Rotation:-
Doubly Rotation:-
No comments:
Post a Comment