An order-statistic tree is an augmented red-black tree that supports fast order-statistic operations. Each node stores an additional field called size that represents the number of nodes in its subtree. The tree allows finding the ith smallest key in O(log n) time using an algorithm called OS-SELECT that traverses the tree.