示例#1
0
        public void oneArray()
        {
            int[] inputArray = new int[] { 5 };

            MBT      mbt          = new MBT();
            TreeNode node         = new TreeNode();
            TreeNode expectedNode = new TreeNode(5);

            node = mbt.construct(inputArray, 0, 1);

            Assert.AreEqual(expectedNode.val, node.val);
        }
示例#2
0
        public void twoArray()
        {
            int[] inputArray = new int[] { 3, 5 };

            MBT      mbt          = new MBT();
            TreeNode node         = new TreeNode();
            TreeNode expectedNode = new TreeNode(5);

            expectedNode.left = new TreeNode(3);

            node = mbt.construct(inputArray, 0, 2);

            Assert.AreEqual(expectedNode.val, node.val);
            Assert.AreEqual(expectedNode.left.val, node.left.val);
        }