Package com.gengoai.graph.algorithms
Class DepthFirstTraversal<V>
- java.lang.Object
-
- com.gengoai.graph.algorithms.AbstractGraphTraversal<V>
-
- com.gengoai.graph.algorithms.DepthFirstTraversal<V>
-
- Type Parameters:
V
- the type parameter
- All Implemented Interfaces:
GraphTraversal<V>
,Serializable
public class DepthFirstTraversal<V> extends AbstractGraphTraversal<V>
Traverses the graph in a depth first fashion.
- Author:
- David B. Bracewell
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description DepthFirstTraversal(Graph<V> graph)
Instantiates a new Depth first visitor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
add(Deque<V> deque, V vertex)
Add.protected V
nextV(Deque<V> deque)
Next v v.-
Methods inherited from class com.gengoai.graph.algorithms.AbstractGraphTraversal
getGraph, iterator
-
-
-
-
Method Detail
-
add
protected void add(Deque<V> deque, V vertex)
Description copied from class:AbstractGraphTraversal
Add.- Specified by:
add
in classAbstractGraphTraversal<V>
- Parameters:
deque
- the dequevertex
- the vertex
-
nextV
protected V nextV(Deque<V> deque)
Description copied from class:AbstractGraphTraversal
Next v v.- Specified by:
nextV
in classAbstractGraphTraversal<V>
- Parameters:
deque
- the deque- Returns:
- the v
-
-