AVL tree

Binary Search Tree (BST) becomes ineffective, O(n) worst case if not balanced. Any practical usage of BST requires a balanced tree. AVL tree is a self-balancing binary search tree which guarantees O(log n) performance.

  • AVL tree balances itself on insertion
read the rest. “AVL tree”
AVL tree

Binary Search Tree Operations (Search, Insertion, Deletion, Successor, Predecessor, Minimum)

Search

Searching for a key in Binary Search Tree (BST). Time complexity O(h) where h being the height of the tree. To leverage the best of BST search, the BST has to be height balanced.

 /**
     * Search in binary 
read the rest. “Binary Search Tree Operations (Search, Insertion, Deletion, Successor, Predecessor, Minimum)”
Binary Search Tree Operations (Search, Insertion, Deletion, Successor, Predecessor, Minimum)