Binary Tree Maximum Path Sum: The Hard Version of Diameter
Any-to-any max path โ clamp negative arms to zero and track the bend. Python solution and complexity analysis for the DFS interview pattern.
The Augmented Dev ยท Archive
Dynamics 365, Power Platform, AI, system design, and web development โ filter by theme or search across every post.
Newsletter
One email per post. No spam, no tracking pixels, unsubscribe anytime.
11 of 325 articles tagged tree-dfs
Any-to-any max path โ clamp negative arms to zero and track the bend. Python solution and complexity analysis for the DFS interview pattern.
Return one thing, track another โ the two-quantity DFS shape. Python solution and complexity analysis for the DFS interview pattern.
The famous swap-children recursion โ and its iterative twin. Python solution and complexity analysis for the DFS interview pattern.
Return what you found โ the split node emerges from the recursion. Python solution and complexity analysis for the DFS interview pattern.
The four-line recursion that teaches the subtree-answer discipline. Python solution and complexity analysis for the DFS interview pattern.
The most-asked grid question โ sink each island as you count it. Python solution and complexity analysis for the DFS interview pattern.
Collect all matching root-to-leaf paths โ append, recurse, pop. Python solution and complexity analysis for the DFS interview pattern.
Root-to-leaf target sums โ subtract as you descend, decide at leaves. Python solution and complexity analysis for the DFS interview pattern.
Walk two trees in lockstep โ the base-case ordering does the work. Python solution and complexity analysis for the DFS interview pattern.
Check mirror symmetry by walking outer-outer and inner-inner pairs. Python solution and complexity analysis for the DFS interview pattern.
The local-check trap, defeated by passing (low, high) down the tree. Python solution and complexity analysis for the DFS interview pattern.