Topological Sort
← Back to Traversal
A linear ordering of vertices in a directed acyclic graph (DAG) such that for every directed edge (u, v), vertex u comes before v. Used in task scheduling, build systems, and dependency resolution. Can be computed via DFS or Kahn’s algorithm (BFS-based).