Topological Sort
A topological order lists every vertex before the vertices it points to. It exists only for a directed acyclic graph. Kahn’s algorithm removes vertices with no incoming edge.
Costs
| Category | Algorithm |
| Difficulty | Medium |
| Time, adjacency list | O(V + E) |
| Requires | a directed acyclic graph |
| A cycle | no topological order |
Questions
What is Topological Sort?
A topological order lists every vertex before the vertices it points to. It exists only for a directed acyclic graph. Kahn’s algorithm removes vertices with no incoming edge.
Where do I practice it?
DSA Master keeps challenges and progress on the phone. This page is the idea and the costs.