DDSA Solutions

Topological Sort

12 problems

Topological sort produces a linear ordering of a DAG where each node comes before its descendants. Two algorithms: DFS (post-order reversal) and BFS Kahn's (process nodes with in-degree 0). Applications: course scheduling, build dependency resolution, and task ordering.