Topological Sorting
Topological sorting produces a linear ordering of vertices in a Directed Acyclic Graph such that for every directed edge u to v, u appears before v. Two standard approaches are Kahn's algorithm using indegrees and a queue, and DFS using finishing times. A valid topological order exists only for a DAG.
Applicable to directed acyclic graphs.
Kahn's algorithm uses indegrees and a queue.
DFS can also generate a topological ordering.
Time complexity: O(V+E).
Common uses include build dependencies and task scheduling.