Example & Tutorial understanding programming in easy ways.

What is AVL trree?

What is AVL Tree :
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

Why AVL tree ?
In binary search tree, in worst case height of binary search tree goes to n and searching of element takes O(n) time.
that's by AVL comes and height of AVL is log(n).

Balancing Factor in AVL tree:
Value of balancing factor is computed by= height of left subtree-height of right subtree.
all possible value of balancing factor is -1,0,1




Read More →