language-icon Old Web
English
Sign In

Order statistic tree

In computer science, an order statistic tree is a variant of the binary search tree (or more generally, a B-tree) that supports two additional operations beyond insertion, lookup and deletion: In computer science, an order statistic tree is a variant of the binary search tree (or more generally, a B-tree) that supports two additional operations beyond insertion, lookup and deletion: Both operations can be performed in O(log n) worst case time when a self-balancing tree is used as the base data structure. To turn a regular search tree into an order statistic tree, the nodes of the tree need to store one additional value, which is the size of the subtree rooted at that node (i.e., the number of nodes below it). All operations that modify the tree must adjust this information to preserve the invariant that where size = 0 by definition. Select can then be implemented as:342 Rank can be implemented as:342 Order-statistic trees can be further amended with bookkeeping information to maintain balance (e.g., tree height can be added to get an order statistic AVL tree, or a color bit to get a red-black order statistic tree). Alternatively, the size field can be used in conjunction with a weight-balancing scheme at no additional storage cost.

[ "Incremental decision tree", "Interval tree", "K-ary tree" ]
Parent Topic
Child Topic
    No Parent Topic