postorder-accumulator-pattern

Status: IN

Tree problems in this repo use a recurring idiom: a postorder DFS function returns one value (e.g., subtree sum, height) while accumulating a second aggregate (e.g., tilt, diameter) into a `nonlocal` closure variable.

Source: entries/2026/06/06/binary-tree-tilt-solution.md

Depended on by

JSON