Randomized binary search tree

From Wikipedia, the free encyclopedia

A randomized binary search tree (abbreviated RBST, also known as Cartesian tree) is a type of binary search tree, with data nodes organized as in a normal binary search tree. Each node has also an access priority, namely p(n) which is chosen in a random fashion according to subtree size, every time a new node is inserted. [1] These priorities are organized in a max heap order.

The expected value of the tree's height is logarithmic in its number of nodes, which ensures good asymptotic running time.

Contents

[edit] Operations on RBST

[edit] Insertions

When a new node is inserted in an RBST of size n, it must be the root of the new tree with probability 1 / (n + 1), and with complementary probability it must be inserted into the appropriate subtree of the root. Inserting at the root requires the split operation, which splits an RBST into two trees. The new root node links up these two subtrees as its left child and right child.

[edit] Deletions

When the RBST node to be deleted is found, its left child and its right child are joined together to form a new RBST. The no longer referenced node is deleted.

[edit] RBST versus treaps

A RBST node has a random priority of the range from 0 to the subtree size, while a treap [2] node has a random priority of the machine's word size. RBST supports searches and deletions by rank. [1] No matter what the approach to randomization we use (random priorities or subtree sizes), the probabilistic properties of RBSTs and treaps are equivalent.

[edit] References

  1. ^ a b Martinez, Conrado & Roura, Salvador (1998), “Randomized binary search trees”, Journal of the ACM (ACM Press) 45 (2): pp. 288-323, <http://citeseer.ist.psu.edu/article/martinez97randomized.html> 
  2. ^ Seidel, Raimund & Aragon, Cecilia R. (1996), “Randomized Search Trees”, Algorithmica 16 (4/5): pp. 464-497, <http://citeseer.ist.psu.edu/seidel96randomized.html> 

[edit] See also

[edit] External links