Пример #1
0
 private void Dfs(Digraph g, int s)
 {
     _marked[s] = true;
     foreach (int w in g.Adj(s))
     {
         if (!_marked[w])
         {
             Dfs(g, w);
         }
     }
 }
 private void DFS(Digraph graph, int v)
 {
     _marked[v] = true;
     foreach (var w in graph.Adj(v))
     {
         if (!_marked[w])
         {
             DFS(graph, w);
         }
         {
         }
     }
 }