예제 #1
0
        public void TestPostTraversal(List <int> expected, SungBinaryTreeNode <int> root)
        {
            var sut    = new SungBinaryTreeTraverser();
            var actual = sut.TraversePost(root).ToList();

            Assert.True(expected.SequenceEqual(actual));
        }
예제 #2
0
        public void TestBuildingTree(SungBinaryTreeNode <int> expected, int[] input)
        {
            var actual = new SungBinaryTreeBuilder().Build(input);

            var traverser    = new SungBinaryTreeTraverser();
            var expectedList = traverser.TraversePost(expected);
            var actualList   = traverser.TraversePost(actual);

            Assert.True(expectedList.SequenceEqual(actualList));
        }