AVL Tree

«  Kadane's Algorithm
Reliable Scalable & Maintainable  »

AVL Tree is a self-balancing binary search tree. In an AVL tree, the hieghts of the two child subtrees of any node differ by at most one. If any time they differ by more than one, rebalancing is done to restore the property.

Lookup, insertion, and deletion all take O(log n) time in both the average and worst cases, where n is the number of nodes in the tree prior to the operation.

Insertaion and deletion may require the tree to be rebalanced by one or more tree rotations.

Compare

AVL tree are faster than red-bblack trees because they are more strictly balanced. AVL trees are height-balanced.

Reference

https://en.wikipedia.org/wiki/AVL_tree

https://www.geeksforgeeks.org/avl-tree-set-1-insertion/

Published on 23 Mar 2020 Find me on Facebook, Twitter!

«  Kadane's Algorithm
Reliable Scalable & Maintainable  »

Comments

    Join the discussion for this article at here . Our comments is using Github Issues. All of posted comments will display at this page instantly.