dsa1 min read
Path Sum — Root-to-Leaf DFS with Running Remainder
Determine if a root-to-leaf path exists with a given sum using DFS that subtracts each node value from the target.
Read →
webcoderspeed.com
1276 articles
Determine if a root-to-leaf path exists with a given sum using DFS that subtracts each node value from the target.
Check if two binary trees are identical by recursively comparing structure and node values.
Check if a binary tree is height-balanced by computing subtree heights and returning -1 early on imbalance.
Merge two binary trees by adding overlapping node values recursively, using existing nodes where possible.
Sum all BST values in [low, high] using BST property to prune entire subtrees outside the range.