ch.bfh.algo.example
Class GraphExampleNonGenerics
java.lang.Object
ch.bfh.algo.example.GraphExampleNonGenerics
public class GraphExampleNonGenerics
- extends Object
The class GraphExampleNonGenerics
contains an example of use
of graph without any generics.
- Version:
- 1.0
- Author:
- Emmanuel Benoist
Method Summary |
Graph |
constructDirectedGraph(int numberOfVertices,
int numberOfEdges)
The constructDirectedGraph method is used to
initialize a default directed Graph . |
static Sequence |
dfsTraversal(Graph g,
List vertices)
The dfsTraversal is an example of the possible
implementation of a Depth First Search traversal of a
Graph . |
static void |
main(String[] args)
|
void |
run()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
GraphExampleNonGenerics
public GraphExampleNonGenerics()
dfsTraversal
public static Sequence dfsTraversal(Graph g,
List vertices)
- The
dfsTraversal
is an example of the possible
implementation of a Depth First Search traversal of a
Graph
. In this case, we use the
DecoratedVertex
to store inside each vertex if it
has been visited.
- Returns:
- a
Sequence
value
constructDirectedGraph
public Graph constructDirectedGraph(int numberOfVertices,
int numberOfEdges)
- The
constructDirectedGraph
method is used to
initialize a default directed Graph
.
The returned graph contains numberOfVertices
vertices and
numberOfEdges
directed edges.
- Returns:
- a
Graph
value
run
public void run()
main
public static void main(String[] args)