$\star$ Basics of DFS & BFS

Recursive Depth First Search (122A)

Breadth First Search (122A)

Runtime

Both DFS and BFS are $O(V + E)$ because they visit all vertices and edges exactly once.

DFS & BFS Problems (WIP)


Go to next:

Minimum Spanning Trees