Splay Tree
A Splay tree is a self-adjusting binary search tree that automatically moves frequently accessed elements closer to the root. After each access, the tree is rearranged (or splayed) to bring the accessed item to the root.
Splay Tree Features:
- Recently accessed elements are quick to access again
- No extra storage needed for balance information
- Simple implementation compared to other balanced trees
- Good performance for localized access patterns
Time Complexity:
- Search: O(log n) amortized
- Insert: O(log n) amortized
- Delete: O(log n) amortized
Use the controls above to perform operations on the Splay tree. Watch how each operation brings the accessed node to the root through a series of rotations.