Concept Flow - Topological Sort Using DFS
Start DFS at unvisited node
Mark node as visited
For each neighbor
If neighbor unvisited
→Recursive DFS on neighbor
Add node to stack after all neighbors visited
Repeat for all nodes
Pop all nodes from stack for topological order
Start DFS from each unvisited node, visit neighbors recursively, then add node to stack. Finally, pop stack for topological order.
