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

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

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