Graph Theory37 sections · 1633 units
Open in Course

When to Use Small-to-Large

(Pattern recognition)

Use small-to-large merging when you need to combine sets, maps, or multisets from children into a parent's structure. If the problem asks for distinct values, frequencies, or any aggregate that requires merging containers, consider this technique. Do not use it if you can solve the problem with simple subtree DP, like sums or counts that combine with addition.

Save it for problems that need to merge data structures.