Design decisions

89. LazyLinkCut<V, T, F> is a second type beside LinkCut (2026-11-21)

  • Decision. Path updates on a dynamic forest are LazyLinkCut.new(act, a) with apply_path(u, v, f), taking the Action that LazySegTree takes; LinkCut keeps no tags. get is mut and splays.
  • Why. SegTree / LazySegTree already split this way, so the name is guessable, and the tag and per-node count would cost LinkCut users (1.01x matched today) memory and time for nothing.
  • Law. apply(f, x.rev(), k) == apply(f, x, k).rev(); every stock action satisfies it.
  • Evidence. bench/trees/lazy_lct_bench: 1.82 s and 2.05 s against C++ 2.11 s and 2.12 s at n = 2 * 10^5, 10^6 operations, identical output.
  • Reverse. Fold the tags into LinkCut<V, T> with an optional act:.