Last Minute Notes
Github
Docs
Learn
Search
⌘
K
@sayanstwt
Lessons
Learn
/
Data Structures & Algorithms
/
Trees & Heaps
Tree DFS
7 min
Beginner
8 steps
Recurse down paths and carry state back up.
Target
22
Leaves
4
Paths found
0
5
4
8
11
13
4
7
2
5
1
find every root-to-leaf path that sums to 22
current
visited
done
In this lesson
Step 1 of 8
1
The problem
2
Three orders
3
Stack
4
Pass down
5
Return up
6
Global best
7
BFS or DFS
8
Recap