Exemple #1
0
 private void DFS(Digraph G, int s)
 {
     Marked[s] = true;
     foreach (var item in G.Adj(s))
     {
         if (!Marked[item])
         {
             DFS(G, item);
         }
     }
 }
Exemple #2
0
 private void DFS(Digraph G, int v)
 {
     Marked[v] = true;
     id[v]     = count;
     foreach (var w in G.Adj(v))
     {
         if (!Marked[w])
         {
             DFS(G, w);
         }
     }
 }