Depth-First Search
Robert Tarjan, 1968
O(V + E)Formalized by Robert Tarjan in 1968, depth-first search explores a graph by plunging as deep as possible along each branch before backtracking. It uses a stack (explicit or via recursion) to remember which nodes to revisit. Unlike BFS's layer-by-layer sweep, DFS follows a single path to its end before trying alternatives. The visualization uses the same tree-like graph as BFS, with the current node in gold, stack nodes marked with a subtle indicator dot, and visited nodes turning teal as the algorithm dives and backtracks.