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

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

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