public void AsDFS()
        {
            BinaryArbor1 <int> tree = GetTestTree();

            int[] targetValues = { 2, 1, 4, 5, 3, 6, 7 };
            Assert.AreEqual(tree.GetEntireFamily().ToArray().Length, targetValues.Length);
            AssertCollectionEquality(tree.GetItemsAsDFS(), targetValues);
        }
Exemplo n.º 2
0
        public void DFSTest()
        {
            BinaryArbor1 <int> tree = GetTestTree();

            int[] targetValues = { 2, 1, 4, 5, 3, 6, 7 };
            var   result       = tree.GetItemsAsDFS().ToArray();

            Console.WriteLine("Expected: " + ListElements(targetValues));
            Console.WriteLine("Actual  : " + ListElements(result));
        }