{"id":"tree-postorder-closure-idiom","text":"Tree solutions combine closure-based DFS (capturing mutable result variables from the enclosing scope for side-effect accumulation) with postorder return values (propagating subtree summaries upward for recursive composition), enabling single-pass O(n) tree computations that both accumulate a global answer and compose local results.","truth_value":"IN","source":"","source_url":"","source_hash":"","justifications":[{"type":"SL","antecedents":["closure-dfs-pattern","postorder-accumulator-pattern"],"outlist":[],"label":"Closures handle cross-subtree accumulation while postorder handles intra-subtree composition — together they cover all tree computation needs"}],"dependents":["traversal-accumulation-universal-across-data-structures"],"metadata":{"last_reviewed":"2026-06-07T22:02:22","review_result":"pass"},"created_at":"","updated_at":"","reviewed_at":"","verified_at":"","retracted_at":"","explanation":{"steps":[{"node":"tree-postorder-closure-idiom","truth_value":"IN","reason":"SL justification valid","antecedents":["closure-dfs-pattern","postorder-accumulator-pattern"],"label":"Closures handle cross-subtree accumulation while postorder handles intra-subtree composition — together they cover all tree computation needs"},{"node":"closure-dfs-pattern","truth_value":"IN","reason":"premise"},{"node":"postorder-accumulator-pattern","truth_value":"IN","reason":"premise"}]}}