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-23 21:22:23
阅读次数:
152
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 ...
分类:
编程语言 时间:
2015-05-23 21:16:11
阅读次数:
196
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 ...
分类:
编程语言 时间:
2015-05-23 19:58:45
阅读次数:
170
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-22 00:04:22
阅读次数:
144
SumRoottoLeafNumbersTotalAccepted:43960TotalSubmissions:144900MySubmissionsQuestionSolutionGivenabinarytreecontainingdigitsfrom0-9only,eachroot-to-leafpathcouldrepresentanumber.Anexampleistheroot-to-leafpath1->2->3whichrepresentsthenumber123.Findtheto..
分类:
其他好文 时间:
2015-05-19 10:57:48
阅读次数:
96
题目:Given a binary tree containing digits from0-9only, each root-to-leaf path could represent a number.An example is the root-to-leaf path1->2->3which ...
分类:
其他好文 时间:
2015-05-18 12:45:37
阅读次数:
100
题目: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 andsu...
分类:
其他好文 时间:
2015-05-17 23:29:44
阅读次数:
153
感觉我这是傻瓜似编程,不过好歹是通过了。class Solution {public:void calcSum(TreeNode* root,int tempNum){if(root->left!=NULL){calcSum(root->left,10*tempNum+root->left->val...
分类:
其他好文 时间:
2015-05-17 16:31:30
阅读次数:
170
题目: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...
分类:
其他好文 时间:
2015-05-17 02:03:11
阅读次数:
116
Maximum Depth of Binary Tree
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-16 20:38:48
阅读次数:
152