← Back

Graph DFS

Depth-first traversal exploring as far as possible then backtrack.

graphsdfsUpdated 2025-09-01

Uses

  • Cycle detection
  • Topological sort

Complexity

  • O(V+E)