DFS — Depth-First Search: Go Deep Before Going Wide
6d ago · 16 min read · 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...
Join discussion





















