示例#1
0
        public void TestIterativeDepthFirstPostOrderSearch(IEnumerable <int> expected, BinaryTreeNode root)
        {
            var sut    = new BinaryTreeNodeTraverser();
            var actual = sut.TraverseDfsPostOrderIterativelyUsingDoubleStack(root);

            Assert.True(expected.SequenceEqual(actual));
        }
示例#2
0
        public void TestRecursiveDepthFirstInOrderSearch(IEnumerable <int> expected, BinaryTreeNode root)
        {
            var sut    = new BinaryTreeNodeTraverser();
            var actual = sut.TraverseDfsInOrderRecursively(root);

            Assert.True(expected.SequenceEqual(actual));
        }