Tree height is the number of edges on the longest path from a tree’s root to a leaf. It estimates the work required by operations that descend through a tree: deeper trees require more steps. section 3.5.2 section 5.5.2
Use height to reason about tree structure and performance:
- Compare a plain binary search tree with a randomized treap by applying identical operation sequences and measuring their heights. section 3.5.2
- Keep disjoint-set trees shallow by attaching the smaller tree beneath the larger one; the resulting height increases by at most one and remains logarithmically bounded. section 5.6
- Estimate recursive findPartition cost from the height of the partition tree, while recognizing that an unbalanced tree can produce linear worst-case work. section 5.5.2
Figure 3.17 The height of a Randomized Treap versus a BST. On both data structures the same operations were performed, and the keys are random integers. Notice that the y axis uses a logarithmic scale.
A height comparison chart makes the practical difference between randomized treaps and binary search trees visible across identical operations. section 3.5.2


