Пример #1
0
        public void PostOrderTestTree6()
        {
            var expected = new List <int> {
                8, 9, 7, 11, 18, 15, 10
            };
            var actual = BinaryTreeTraversePostOrder2IterativeComplete.TraversePostOrder(BinaryTreeNodeTestData.Tree6);

            CollectionAssert.AreEqual(expected, actual);
        }
Пример #2
0
        public void PostOrderTestTree14()
        {
            var expected = new List <int> {
                6, 4, 2, 7, 5, 3, 1
            };
            var actual = BinaryTreeTraversePostOrder2IterativeComplete.TraversePostOrder(BinaryTreeNodeTestData.Tree14);

            CollectionAssert.AreEqual(expected, actual);
        }
Пример #3
0
        public void PostOrderTestTree12()
        {
            var expected = new List <int> {
                5, 7, 6, 10, 12, 11, 9, 16, 18, 17, 24, 26, 25, 23, 15
            };
            var actual = BinaryTreeTraversePostOrder2IterativeComplete.TraversePostOrder(BinaryTreeNodeTestData.Tree12);

            CollectionAssert.AreEqual(expected, actual);
        }
Пример #4
0
        public void PostOrderTestNullTree()
        {
            var actual = BinaryTreeTraversePostOrder2IterativeComplete.TraversePostOrder(null);

            Assert.AreEqual(0, actual.Count);
        }