Splay Tree Implementation in C++
—SplayTrees are a form of binary search tree with the unique property that the most recently accessed element is located at the root of the tree to save access time.
Splay trees have time complexity of O(logN) in most cases but can have O(N) in some cases. Unlike AVL/Red-Black trees Splay Trees do not have a strictly self-balancing feature. Balancing is achieved using rotations. Splay trees are faster as they are not strictly balanced.
- include the header file
- create a splay tree object
- use the methods to use the splay tree