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.
分析;
此题是求二叉树的深度,(无所谓最大深度),用递归的方法很容...
分类:
其他好文 时间:
2015-05-14 14:18:49
阅读次数:
117
题目:Given a binary tree, return thebottom-up level ordertraversal of its nodes' values. (ie, from left to right, level by level from leaf to root).For ...
分类:
其他好文 时间:
2015-05-14 11:43:09
阅读次数:
129
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
Given a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the values along the path equals the given sum.
For example:
Given the below binary tree and sum
...
分类:
其他好文 时间:
2015-05-10 17:19:39
阅读次数:
92
Given a binary tree and a sum, find all root-to-leaf paths where each path's sum equals the given sum.
For example:
Given the below binary tree and sum
= 22,
5
/ ...
分类:
其他好文 时间:
2015-05-10 09:43:32
阅读次数:
103
Given a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the values along the path equals the given sum.
For example:
Given the below binary tree and sum
...
分类:
其他好文 时间:
2015-05-09 15:04:08
阅读次数:
99
Given a binary tree, return the bottom-up level order traversal of its nodes' values. (ie, from left to right, level by level from leaf to root).
For example:
Given binary tree {3,9,20,#,#,15,7},
...
分类:
其他好文 时间:
2015-05-08 18:18:47
阅读次数:
138
Given a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the values along the path equals the given sum.Fo...
分类:
其他好文 时间:
2015-05-08 10:46:27
阅读次数:
112
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, return the bottom-up level order traversal of its nodes' values. (ie, from left to right, level by level from leaf to root).For e...
分类:
其他好文 时间:
2015-05-06 10:39:11
阅读次数:
127