|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.mhhe.clrs2e.TopoSort
Class that topologically sorts a DAG. Based on the Topological-Sort procedure on page 550 of Introduction to Algorithms, Second edition.
Nested Class Summary | |
private class |
TopoSort.TopoSortDFS
Inner class to do DFS but with inserting finished vertices onto the front of the linked list. |
Field Summary | |
private com.mhhe.clrs2e.SentinelDLL |
list
A linked list of vertices. |
Constructor Summary | |
TopoSort()
|
Method Summary | |
com.mhhe.clrs2e.Vertex[] |
topologicalSort(com.mhhe.clrs2e.AdjacencyListGraph g)
Performs a topological sort on a graph. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private com.mhhe.clrs2e.SentinelDLL list
Constructor Detail |
public TopoSort()
Method Detail |
public com.mhhe.clrs2e.Vertex[] topologicalSort(com.mhhe.clrs2e.AdjacencyListGraph g)
g
- The graph.
g
in which the
vertices appear in the array in topologically sorted order.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |