package org.psjava.algo.graph.dfs;

import org.psjava.ds.graph.AdjacencyListFromGraph;
import org.psjava.ds.graph.DirectedEdge;
import org.psjava.ds.graph.Graph;
import org.psjava.ds.map.MutableMap;

public class SingleSourceDFS {
	public static <V, E extends DirectedEdge<V>> void traverse(Graph<V, E> graph, V start, DFSVisitor<V, E> visitor) {
		MutableMap<V, DFSStatus> status = DFSCore.createInitialStatus(graph.getVertices());
		DFSCore.traverse(AdjacencyListFromGraph.create(graph), status, start, visitor);
	}
}

@@ -31,16 +31,59 @@
 dfs;%0D%0A%0D%0A
+import org.psjava.ds.graph.AdjacencyList;%0D%0A
 import o
@@ -118,32 +118,32 @@
 ListFromGraph;%0D%0A
-
 import org.psjav
@@ -275,16 +275,18 @@
 eDFS %7B%0D%0A
+%0D%0A
 %09public 
@@ -394,16 +394,264 @@
 tor) %7B%0D%0A
+%09%09// TODO inline%0D%0A%09%09AdjacencyList%3CV, E%3E adj = AdjacencyListFromGraph.create(graph);%0D%0A%09%09traverse(adj, start, visitor);%0D%0A%09%7D%0D%0A%0D%0A%09public static %3CV, E extends DirectedEdge%3CV%3E%3E void traverse(AdjacencyList%3CV, E%3E adj, V start, DFSVisitor%3CV, E%3E visitor) %7B%0D%0A
 %09%09Mutabl
@@ -706,21 +706,19 @@
 lStatus(
-graph
+adj
 .getVert
@@ -750,44 +750,11 @@
 rse(
-A
+a
 dj
-acencyListFromGraph.create(graph)
 , st

introduce fast method interface