πŸ“Š Topological Sort

Visualize DFS-based and Kahn's algorithms on a DAG

πŸ”„ DFS-based Run DFS, output nodes in reverse finish order. O(V+E).
πŸ“₯ Kahn's Algorithm Repeatedly remove nodes with in-degree 0. O(V+E).
Click "Next Step" to begin topological sort
Unvisited
Visiting (Gray)
Finished (Black)
Current