Exemple #1
0
        public void Test()
        {
            var root = new Tree <int>(1);

            root.left        = new Tree <int>(2);
            root.right       = new Tree <int>(2);
            root.left.right  = new Tree <int>(3);
            root.right.right = new Tree <int>(3);

            var thing = IsTreeBalanced.Run(root);
        }
Exemple #2
0
        public bool?Is_Min_Height_Produced(int[] @array)
        {
            TreeNode <int> treeNode = RunTest(@array, new CreateTreeWithMinHeightFromAscOrderAlgorithm());

            if (treeNode == null)
            {
                return(null);
            }

            var isTreeBalanced = new IsTreeBalanced();

            return(isTreeBalanced.Execute(treeNode));
        }