DFS explores a graph by diving deep into each branch before backtracking. It leverages a stack—either implicitly via recursion or explicitly—to track nodes for exploration.
Memory-efficient for deep graphs
Explore one branch completely before others
Not guaranteed to find the shortest path
Useful in topological sorting or cycle detection
DFS is memory-efficient for very deep graphs but may not find the shortest path