{"id":"closure-dfs-pattern","text":"Tree solutions use closure-based DFS where the inner `dfs` function captures a `result` list from the enclosing scope, avoiding return-value plumbing while keeping the recursion signature clean.","truth_value":"IN","source":"entries/2026/06/06/find-all-the-lonely-nodes-solution.md","source_url":"","source_hash":"","justifications":[],"dependents":["tree-postorder-closure-idiom"],"metadata":{},"created_at":"","updated_at":"","reviewed_at":"","verified_at":"","retracted_at":"","explanation":{"steps":[{"node":"closure-dfs-pattern","truth_value":"IN","reason":"premise"}]}}