예제 #1
0
 public static void ShowMarked(this DiGraph dg)
 {
     Console.Write("Marked: ");
     DirectedDFS reachable = new DirectedDFS(dg, dg.V);
     for (int v = 0; v < dg.V; v++)
         if (reachable.Marked(v))
             Console.Write(v + " ");
     Console.WriteLine();
 }
예제 #2
0
        public static void ShowMarked(this DiGraph dg)
        {
            Console.Write("Marked: ");
            DirectedDFS reachable = new DirectedDFS(dg, dg.V);

            for (int v = 0; v < dg.V; v++)
            {
                if (reachable.Marked(v))
                {
                    Console.Write(v + " ");
                }
            }
            Console.WriteLine();
        }