예제 #1
0
파일: Program.cs 프로젝트: Beraliv/Csharp
 public Node(Node node)
 {
     Marked = node.Marked;
     F = node.F;
     L = node.L;
     Number = node.Number;
 }
예제 #2
0
파일: Program.cs 프로젝트: Beraliv/Csharp
        public void DFS(ref Node s, ref int t, int i)
        {
            adjacency_list[i].Key.Marked = true;
            adjacency_list[i].Key.L = s;

            foreach (var item in adjacency_list[i].Value)
            {
                int index = adjacency_list.FindIndex(x => x.Key.Number == item);

                if (!adjacency_list[index].Key.Marked)
                    DFS(ref s, ref t, index);
            }
            t++;
            adjacency_list[i].Key.F = t;
        }