Data Structures19 sections · 729 units
Open in Course

Preferred Paths

The core idea

Link-Cut trees partition each tree into vertex-disjoint paths called preferred paths. Each node has at most one preferred child.

The path from a node down through preferred children is a preferred path. ```text 1 /|
2 3 4 Preferred edges: 1-2, 2-5 /| | Preferred path: 1-2-5 5 6 7 Other paths: 3, 4-7, 6


Each preferred path is stored in a splay tree, ordered by depth (top of path = leftmost in splay tree). Time: $O(\log n)$ amortized. Space: $O(n)$.