Topological Sort

Given a digraph, put the vertices in order such that all its directed edges point from a vertex earlier in the order to a vertex later in the order (or report that doing so is not possible).

Directed Graph
Topological Sort

https://algs4.cs.princeton.edu/42digraph/Topological.java.html

Last updated

Was this helpful?