What is the importance of the AVL tree?
AVL Tree(Hight - Balance Tree)
It is nothing but a Binary Search Tree (BST) with balance factor.
Balance Factor can be -1, 0, 1.
Balance Factor
Hight of left subtree - Hight of Right subtree.
Application of AVL tree
It is use to perform searching in O(log n) Time complexity.
Importance of AVL tree
Searching can be done by Binary Search Tree (BST) but if element are already sorted BST take form of chain and time complexity is O(n).
To overcome this problem AVL tree is introduced.
Due to balance factor it never take a form of chain, in fact AVL tree is nearly complete Binary tree.
Operations like Insertion, Deletion, Searching in a tree take O(log n) Time in worst case and Average case.
Comments
Post a Comment