Example #1
0
        public void setRootNode()
        {
            int[] inputArray   = new int[] { 5 };
            var   mbt          = new MBT();
            var   rootTreeNode = mbt.ConstructMaximumBinaryTree(inputArray);

            Assert.AreEqual(5, rootTreeNode.val);
        }
Example #2
0
        public void leftandrightRootNode()
        {
            int[] inputArray   = new int[] { 1, 5, 3 };
            var   mbt          = new MBT();
            var   rootTreeNode = mbt.ConstructMaximumBinaryTree(inputArray);

            Assert.AreEqual(5, rootTreeNode.val);
            Assert.AreEqual(1, rootTreeNode.left.val);
            Assert.AreEqual(3, rootTreeNode.right.val);
        }