Example #1
0
        static void Main(string[] args)
        {
            tree tree = new tree(1)
            {
                left = new tree(2)
                {
                    left = new tree(3)
                    {
                        left = new tree(4), right = new tree(5)
                    }
                }, right = new tree(6)
                {
                    left = new tree(7), right = new tree(8)
                }
            };
            solution solution = new solution();

            Console.WriteLine(solution.MaxDepth(tree));
            Console.Read();
        }
Example #2
0
        static void Main(string[] args)
        {
            TreeNode treeNode = new TreeNode(1)
            {
                left = new TreeNode(2)
                {
                    left = new TreeNode(3)
                    {
                        left = new TreeNode(4)
                    }
                },
                right = new TreeNode(2)
                {
                    right = new TreeNode(3)
                    {
                        right = new TreeNode(4)
                    }
                }
            };

            solution solution = new solution();

            solution.IsBalanced(treeNode);
        }
Example #3
0
        static void Main(string[] args)
        {
            solution solution = new solution();

            solution.GetRow(3);
        }
Example #4
0
 static void Main(string[] args)
 {
     solution solution = new solution();
     solution.ClimbStairs(8);
 }
Example #5
0
        static void Main(string[] args)
        {
            solution solution = new solution();

            solution.LengthOfLastWord("b   a    ");
        }
Example #6
0
        static void Main(string[] args)
        {
            solution solution = new solution();

            solution.CountAndSay(5);
        }
Example #7
0
        static void Main(string[] args)
        {
            solution solution = new solution();

            solution.Generate(5);
        }
Example #8
0
        static void Main(string[] args)
        {
            solution solution = new solution();

            solution.mysqrt(2147483647);
        }