DFS
← Back to Traversal
Depth-First Search explores a graph by going as deep as possible along each branch before backtracking, using a stack (or recursion). DFS is the basis for topological sorting, cycle detection, and finding connected components.