agl2.alg
Class DepthFirstSearch
java.lang.Object
|
+--agl2.alg.DepthFirstSearch
- public class DepthFirstSearch
- extends java.lang.Object
Perform DepthFirstSearch
on a graph.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DepthFirstSearch
public DepthFirstSearch(VertexGraph g,
GraphVisitor v)
- Initialize the depth first of the vertex graph
- Parameters:
g
- a graphv
- a visitor
DepthFirstSearch
public DepthFirstSearch(VertexGraph g)
apply
public void apply(java.lang.Object root,
GraphVisitor v)
apply
public void apply(java.lang.Object root)
- Apply the alorithm begining at root
- Parameters:
root
- The root node (or null)
nodeIterator
public static java.util.Iterator nodeIterator(VertexGraph g,
java.lang.Object root)
nodeReverseIterator
public static java.util.Iterator nodeReverseIterator(VertexGraph g,
java.lang.Object root)