Skip to content

Link-Cut Tree Hot Sheet

Use this page when the forest changes online and you still need path connectivity or one path aggregate to stay logarithmic.

Do Not Use When

Choose By Signal

Core Invariants

  • the represented forest and the auxiliary splay trees are different objects
  • access(u) exposes one represented root-to-u path
  • makeroot(u) is access(u) plus a lazy path reversal
  • after makeroot(u) then access(v), the whole path u -> v sits in v's auxiliary tree
  • is_root(x) means root of the current auxiliary splay tree, not root of the represented tree

Main Traps

  • rotating before pushing reverse flags
  • reading auxiliary parents as represented-tree parents
  • using LCT for static trees where HLD or Euler flattening is simpler
  • overclaiming subtree support from a path-only starter
  • forgetting that the exact repo starter is vertex-valued point-add + path-sum

Exact Starter Route

Reopen Paths