public class OrderedDepthFirstSearch<T extends OrderedDfsVertex>
extends java.lang.Object
Constructor and Description |
---|
OrderedDepthFirstSearch(AbstractGraph<T> graph)
If comparator is unspecified, use SearchOrderComparator as the default.
|
OrderedDepthFirstSearch(AbstractGraph<T> graph,
java.util.Comparator<OrderedSearchVertex> comp)
Prepares the graph for a depth-first search where vertices
are visited in the order specified by the Comparator passed
to this constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
search()
Conduct a depth-first search on the graph, visiting vertices
in the order specified in the constructor.
|
public OrderedDepthFirstSearch(AbstractGraph<T> graph, java.util.Comparator<OrderedSearchVertex> comp)
graph
- The graph to be searchedcomp
- Comparator determining the order in which vertices
will be visited.public OrderedDepthFirstSearch(AbstractGraph<T> graph)
graph
- graph to searchpublic void search()