private void PostVisit(DataStructure.Graph.Simple2.Vertex v) { if (addtoStack) { stack.Push(v); } }
private void DFS(DataStructure.Graph.Simple2.Vertex v) { if (visited[v.Value]) { return; } PreVisit(v); foreach (var w in v.Neighbours) { DFS(w); } }
private void PreVisit(DataStructure.Graph.Simple2.Vertex v) { visited[v.Value] = true; id[v.Value] = count; }