Maximum Depth of Binary Tree
Total Accepted: 63668 Total Submissions: 141121 My Submissions
Question Solution Given a binary tree, find its maximum depth.The maximum depth is the number of nodes...
分类:
其他好文 时间:
2015-05-13 23:19:39
阅读次数:
302
Given a binary tree, find its maximum depth.
The maximum depth is the number of nodes along the longest path from the root node down to the farthest leaf node./**
* Definition for binary tree
* stru...
分类:
其他好文 时间:
2015-05-13 19:42:48
阅读次数:
143
Balanced Binary Tree
Given a binary tree, determine if it is height-balanced.
For this problem, a height-balanced binary tree is defined as a binary tree in which the depth of the two subtrees...
分类:
其他好文 时间:
2015-05-12 15:37:49
阅读次数:
113
代码:/** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : va...
分类:
其他好文 时间:
2015-05-12 00:00:59
阅读次数:
140
1.Maximum Depth of Binary Tree这是道简单的分治习题了分:左子树最大深度右子树最大深度治:最大深度等于max(左子树,右子树)+1public class Solution { public int maxDepth(TreeNode root) { ...
分类:
编程语言 时间:
2015-05-10 15:29:25
阅读次数:
1098
Given a binary tree, determine if it is height-balanced.
For this problem, a height-balanced binary tree is defined as a binary tree in which the depth of the two subtrees of every node never diffe...
分类:
其他好文 时间:
2015-05-09 13:29:28
阅读次数:
101
Given a binary tree, determine if it is height-balanced.
For this problem, a height-balanced binary tree is defined as a binary tree in which the depth of the two subtrees of every node never diffe...
分类:
其他好文 时间:
2015-05-07 18:57:13
阅读次数:
93
Given a binary tree, find its maximum depth.
The maximum depth is the number of nodes along the longest path from the root node down to the farthest leaf node.
基本思路:
深度优先遍历。
在leetcode上实行执行时间...
分类:
其他好文 时间:
2015-05-06 23:08:25
阅读次数:
184
Given a binary tree, determine if it is height-balanced.For this problem, a height-balanced binary tree is defined as a binary tree in which the depth...
分类:
其他好文 时间:
2015-05-06 15:01:56
阅读次数:
84
https://leetcode.com/problems/balanced-binary-tree/https://leetcode.com/discuss/28162/java-o-n-solution-based-on-maximum-depth-of-binary-treeGiven a b...
分类:
其他好文 时间:
2015-05-05 18:52:21
阅读次数:
128