Create a new randomized Splay Tree
Optional
compareFn: anyWhen an element is accessed, with probability p
splay the tree. With probability 1 - p
, leave the tree as it is.
Protected
cmpProtected
countProtected
randProtected
Optional
rootReturns the total number of elements in the collection.
This is the simplified top-down splaying method proposed by Sleator and Tarjan in Self-Adjusting Binary Search Trees.
Generated using TypeDoc
A splay tree is a self-balancing binary search tree with the additional property that recently accessed elements are quick to access again. Insertion, look-up and removal in O(log n) amortized time. For many patterns of non-random operations splay trees can take better than logarithmic time, without requiring advance knowledge of the pattern.
See
Template
V