DFS

3 problems using this pattern

About this pattern:

Depth-first search for exploring all paths in trees and graphs recursively.

Complexity Range

Time Complexity

O(n) (2 problems)
O(V + E) (1 problem)

Space Complexity

O(h) (2 problems)
O(V) (1 problem)

Problems Using DFS

← Back to All Patterns