由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
JobHunting版 - 这个题做的对吗?
相关主题
感觉leetcode的OJ有点太偏重DP了问个binary tree node path的概念问题
Careercup 4.9解释一下?Binary Tree Maximum Path Sum
讨论一道LeetCode题:Binary Tree Maximum Path SumGiven a binary tree, find the maximum path sum
Leetcode bst max path-----is this solution correct?Recursion算法复杂度计算一问
问道150上的题:sum of path in binary tree请教CareerCup中的ROBOT MATRIX PATH那道题
cc150上面binary tree找所有sum==target的path,不一定从root出发又有leetcode题目来请教了
求LeetCode Binary Tree Level Order Traversal II解法Finding all paths sum up to a given value in 150不对吧?
Leetcode上Binary Tree Level Order Traversal II的疑问请教一个cracking coding interview书上的问题
相关话题的讨论汇总
话题: tree话题: value话题: design话题: note话题: path
进入JobHunting版参与讨论
1 (共1页)
y***n
发帖数: 1594
1
You are given a binary tree in which each node contains a value. Design an
algorithm to print all paths which sum up to that value. Note that it can be
any path in the tree - it does not have to start at the root.
看了一下这个,好像不太对。 http://hawstein.com/posts/4.8.html
m*****n
发帖数: 2152
2
解法2,对。但是好像内存管理有问题,要copy多少次vector啊?
用reference要好一点。
l*********8
发帖数: 4642
3
1
/ \
2 3
2-1-3不算一条路径吗? 题解里都没有考虑
a**********0
发帖数: 422
4
我觉得他们似乎不做题 这个是leetcode的原题 你说的算一个path
就是递归做

【在 l*********8 的大作中提到】
: 1
: / \
: 2 3
: 2-1-3不算一条路径吗? 题解里都没有考虑

y***n
发帖数: 1594
5
leetCode 的那个题是这样的,我看不出来.
a**********0
发帖数: 422
6
原题是求最大的好像 但是每次如果找到 就加到arraylist里边 和原题差别也不大啊

【在 y***n 的大作中提到】
: leetCode 的那个题是这样的,我看不出来.
y***n
发帖数: 1594
7
我的能力就是不能把题转换成相似的题。
原来学文科的,差了一点。。
y***n
发帖数: 1594
8
写了一个,还是太烦,求好的解法。。
http://ideone.com/FQgiU8
1 (共1页)
进入JobHunting版参与讨论
相关主题
请教一个cracking coding interview书上的问题问道150上的题:sum of path in binary tree
Career cup 4.9 path sum的答案肯定错了cc150上面binary tree找所有sum==target的path,不一定从root出发
再来题目求LeetCode Binary Tree Level Order Traversal II解法
借人气问一道Samsung的题Leetcode上Binary Tree Level Order Traversal II的疑问
感觉leetcode的OJ有点太偏重DP了问个binary tree node path的概念问题
Careercup 4.9解释一下?Binary Tree Maximum Path Sum
讨论一道LeetCode题:Binary Tree Maximum Path SumGiven a binary tree, find the maximum path sum
Leetcode bst max path-----is this solution correct?Recursion算法复杂度计算一问
相关话题的讨论汇总
话题: tree话题: value话题: design话题: note话题: path