예제 #1
0
        public void DirectedDFS_input2_0to5()
        {
            var         g   = initDG();
            DirectedDFS d   = new DirectedDFS(g, 2);
            string      res = "";

            for (int v = 0; v < g.v(); v++)
            {
                if (d.marked(v))
                {
                    res += v;
                    res += " ";
                }
            }
            Assert.AreEqual(res, "0 1 2 3 4 5 ");
        }
예제 #2
0
        public void DirectedDFS_input1_2_6_output0to6_9to12()
        {
            var        g      = initDG();
            List <int> source = new List <int>()
            {
                1, 2, 6
            };
            DirectedDFS d   = new DirectedDFS(g, source);
            string      res = "";

            for (int v = 0; v < g.v(); v++)
            {
                if (d.marked(v))
                {
                    res += v;
                    res += " ";
                }
            }
            Assert.AreEqual(res, "0 1 2 3 4 5 6 9 10 11 12 ");
        }