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