Depth-First Search
DFS explores as far as possible along one path before backtracking. It can be implemented recursively using the call stack or iteratively using an explicit stack. DFS is fundamental for cycle detection, topological sorting, connected components, and strongly connected component algorithms.
Primary data structure: Stack or recursion stack.
Explores deeply before backtracking.
Useful for connectivity and cycle detection.
Iterative DFS uses an explicit stack.
0-2 years experience
2-5 years experience
5-8 years experience
8+ years experience