示例#1
0
        public void DFSBinarySearchTreePostOrderIterativeTest()
        {
            var binarySearchTree = new BinarySearchTreeKey();

            binarySearchTree.Add("4");
            binarySearchTree.Add("2");
            binarySearchTree.Add("6");
            binarySearchTree.Add("1");
            binarySearchTree.Add("3");
            binarySearchTree.Add("5");
            binarySearchTree.Add("7");

            Assert.Equal(new [] { "1", "3", "2", "5", "7", "6", "4" }, DFS.DFSBinarySearchTreePostOrderIterative(binarySearchTree.Root));
        }