DFS — Depth-First Search: Go Deep Before Going Wide
TLDR: DFS explores a graph by diving as deep as possible along each path before backtracking, using a call stack (recursion) or an explicit stack. It is the go-to algorithm for cycle detection, path finding, topological sort, and connected components...
abstractalgorithms.dev16 min read