示例#1
0
        public void Recursive_StartFromE()
        {
            var dfsOrdering = new List <GraphNode <string> >();

            DFS.DFS_Recursive(_nodeE, dfsOrdering);

            Assert.AreEqual(7, dfsOrdering.Count);

            Assert.AreEqual("E", dfsOrdering[0].Value);
            Assert.AreEqual("B", dfsOrdering[1].Value);
            Assert.AreEqual("F", dfsOrdering[2].Value);
            Assert.AreEqual("D", dfsOrdering[3].Value);
            Assert.AreEqual("A", dfsOrdering[4].Value);
            Assert.AreEqual("C", dfsOrdering[5].Value);
            Assert.AreEqual("G", dfsOrdering[6].Value);
        }