Image for Splay tree

Splay tree

A splay tree is a type of self-adjusting binary search tree that reorganizes itself whenever you access a node. When you search for or modify a node, the tree moves that node closer to the top (the root) through a process called "splaying." This adjustment makes frequently accessed nodes quicker to reach in future operations, improving overall efficiency for workloads with repetitive data access patterns. Splay trees are simple to implement and work well in situations where certain data is accessed repeatedly, maintaining an average operation time close to logarithmic in the number of elements.