TreesEvidence Contributing
Tree Path Value Accumulation
Carry a running value down (or aggregate a value up) a root-to-leaf or arbitrary path during DFS.
Practice Problems: 5
Difficulty: 2 Easy·2 Medium·1 Hard
Core technique
Review the technique, then try the mapped problems below. The right approach depends on each problem's constraints.
- Core Strategy: Carry a running value down (or aggregate a value up) a root-to-leaf or arbitrary path during DFS.