Splay Tree | Set 1 (Search) The worst case time complexity of Binary Search Tree (BST) operations like search, delete, insert is O(n). The worst case occurs when the tree is skewed. We can get the worst case time complexity as O(Logn) with AVL and Red-Black Trees. Can we do better than AVL or Red-Black trees in practical situations? Like AVL and Red-Black Trees, Splay tree is also self-balancing BST . The main idea of splay tree is to bring the recently accessed item to root of the tree, this makes the recently searched item to be accessible in O(1) time if accessed again.
Read full article from Splay Tree | Set 1 (Search) | GeeksforGeeks
No comments:
Post a Comment