private void DepthFirstSeach( Graph graph, int sourceVertex ) { _marked[sourceVertex] = true; foreach ( int vertex in graph.Adjacent( sourceVertex ) ) { if ( !_marked[vertex] ) { _edgeTo[vertex] = sourceVertex; DepthFirstSeach( graph, vertex ); } } }
private void DepthFirstSeach(Graph graph, int sourceVertex) { _marked[sourceVertex] = true; foreach (int vertex in graph.Adjacent(sourceVertex)) { if (!_marked[vertex]) { _edgeTo[vertex] = sourceVertex; DepthFirstSeach(graph, vertex); } } }