예제 #1
0
        public void TestingDFSPostOrder(int[] arr, int[] expected)
        {
            var binarySearchTree = new BinarySearchTree();

            for (int i = 0; i < arr.Length; i++)
            {
                binarySearchTree.Insert(arr[i]);
            }

            List <int> list             = new List <int>();
            var        depthFirstSearch = new DepthFirstSearch();
            var        result           = depthFirstSearch.DFSPostOrder(binarySearchTree.root, list);

            Assert.AreEqual(expected, result);
        }