Concept Flow - Topological Sort Using DFS
Start with all nodes
Pick unvisited node
DFS: Visit node
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, recursively visit neighbors, then add nodes to stack after visiting all neighbors. Finally, pop stack for topological order.
