A red-black tree gives search, insertion, and deletion — but nothing else out of the box: it cannot answer "what is the rank of this key?" or "which stored interval overlaps this query point?" without an scan. Augmentation is the general technique for extending a balanced tree with extra per-node fields that answer new query types in , without sacrificing the balance guarantee — provided the new fields can be recomputed cheaply after a rotation. This note states the general augmentation recipe and applies it to two named structures: the order-statistics tree (rank/select queries) and the interval tree (overlap queries).
In this lesson
- Learning objectives
- The augmentation recipe
- Order-statistics trees
- Interval trees
Before you start
The full lesson, with worked examples and exercise solutions, is for members.
Read the full lessonNew to SelfMadeQuant.com? See membership options or explore the curriculum.