ADS
Algorithms and Data Structures
Loading...
Searching...
No Matches
LinkCutTree.h

The link-cut trees of Sleator and Tarjan, beyond the book. More...

Files

file  ADS/tree/LinkCutTree.h
 The link-cut trees of Sleator and Tarjan, beyond the book: a forest of rooted trees on the nodes \( 0 , \ldots , n - 1 \) that changes by link() and cut() of an edge, and answers connected(), findRoot(), the lowest common ancestor lca() and the aggregate of the values of the nodes on the path between two nodes, aggregate(), each in \( O( \log n ) \) amortized time (see Dynamic trees).

Classes

class  ADS::LinkCutTree< T, Op, Policy >
 a forest of dynamic trees whose nodes have values of the type T, aggregated on the paths by the commutative monoid Op, its changes told through Policy More...

Detailed description

The link-cut trees of Sleator and Tarjan, beyond the book.

The definitions, the invariants and the costs of the area are in Theory of trees.