public interface TopSortInterface
Modifier and Type | Method and Description |
---|---|
boolean |
isTopSorted(boolean forward)
Return true if no resetTopSorted(forward) has been executed
since the last setTopSorted(forward) has been executed
|
int |
numberOfNodes()
Return the number of nodes in the graph
|
void |
resetTopSorted()
Should have a side effect such that isTopSorted(forward)
returns the correct value.
|
void |
setTopSorted(boolean forward)
Should have a side effect such that isTopSorted(forward)
returns the correct value.
|
SortedGraphNode |
startNode(boolean forward)
Return the start node if forward = true for forward topsort,
and return the end node if forward = false for backward topsort.
|
SortedGraphNode startNode(boolean forward)
forward
- whether we are viewing the graph in the forward directionint numberOfNodes()
boolean isTopSorted(boolean forward)
forward
- whether we are viewing the graph in the forward directionvoid setTopSorted(boolean forward)
forward
- whether we are viewing the graph in the forward directionvoid resetTopSorted()