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(); }
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); }
static void Main(string[] args) { solution solution = new solution(); solution.GetRow(3); }
static void Main(string[] args) { solution solution = new solution(); solution.ClimbStairs(8); }
static void Main(string[] args) { solution solution = new solution(); solution.LengthOfLastWord("b a "); }
static void Main(string[] args) { solution solution = new solution(); solution.CountAndSay(5); }
static void Main(string[] args) { solution solution = new solution(); solution.Generate(5); }
static void Main(string[] args) { solution solution = new solution(); solution.mysqrt(2147483647); }