A Splay Tree is a type of self-adjusting binary search tree that reorganizes itself whenever an access operation is performed. The primary idea behind a splay tree is that recently accessed elements are likely to be accessed again soon, so it brings these elements closer to the root of the tree. This is done through a process called splaying, which involves a series of tree rotations to move the accessed node to the root.
Key operations include:
Splay trees provide good amortized performance, with time complexity averaged over a sequence of operations being for insertion, deletion, and searching, although individual operations can take up to time in the worst case.
Start your personalized study experience with acemate today. Sign up for free and find summaries and mock exams for your university.