complexitygraphs
Use indegrees to order dependencies
Anonymous
for a directed acyclic graph, count each node's incoming edges and start with the nodes at zero. Remove one, add it to the order, and reduce the counts of its neighbors. If fewer than V nodes are added, a cycle remains. The scan takes O(V + E) time.
0