Groups
Category
Small-to-large merging is a technique where you always merge the smaller container into the larger one to guarantee low total work.
Rerooting (a.k.a. 换根 DP) computes a per-node answer as if each node were the root, in total O(n) time on trees.