public class TopologicalSort extends Object
| Constructor and Description |
|---|
TopologicalSort() |
| Modifier and Type | Method and Description |
|---|---|
static <T> List<T> |
sort(DirectedGraph<T> g)
Given a directed acyclic graph, returns a topological sorting of the
nodes in the graph.
|
public static <T> List<T> sort(DirectedGraph<T> g)
g - A directed acyclic graph.IllegalArgumentException - If the graph is not a DAG.Copyright © 2020. All rights reserved.