Order statistic tree (source code)

= Order statistic tree
{wiki=Order_statistic_tree}

An Order Statistic Tree is a type of balanced binary search tree (BST) that allows the efficient retrieval of the k-th smallest (or largest) element in a dynamic set of data. It extends the functionality of standard binary search trees by augmenting each node with additional information that helps maintain order statistics. \#\#\# Key Features of Order Statistic Tree: 1. **Augmented Nodes**: Each node in the tree maintains an extra attribute, often referred to as the "size" of the subtree.