由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
JobHunting版 - 问道150上的题:sum of path in binary tree
相关主题
借人气问一道Samsung的题Leetcode bst max path-----is this solution correct?
这个题做的对吗?感觉leetcode的OJ有点太偏重DP了
cc150上面binary tree找所有sum==target的path,不一定从root出发Given a binary tree, find the maximum path sum
求教balanced binary tree的准确定义再来题目
问个binary tree node path的概念问题这个Binary Tree的题来看看
Careercup 4.9解释一下?请教find number of duplicates in a binary search tree
Binary Tree Maximum Path Sum上几个面经顺求Bless
讨论一道LeetCode题:Binary Tree Maximum Path SumUnique Binary Search Trees II的复杂度怎么算啊?多谢!
相关话题的讨论汇总
话题: sum话题: tree话题: path话题: binary话题: 问道
进入JobHunting版参与讨论
1 (共1页)
s******o
发帖数: 2233
1
第四版的4.8:
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.
书上的解法貌似只考虑root左边或者右边subtree里的path,比如下面这个找sum=6的就
找不出来,
2
1 3
想确认一下我的理解对不对。如果需要考虑这种情况有什么简洁点的做法?
1 (共1页)
进入JobHunting版参与讨论
相关主题
Unique Binary Search Trees II的复杂度怎么算啊?多谢!问个binary tree node path的概念问题
a question regarding finding all paths with a common sumCareercup 4.9解释一下?
问两道facebook面试题Binary Tree Maximum Path Sum
发个TA(猫头鹰)的面筋讨论一道LeetCode题:Binary Tree Maximum Path Sum
借人气问一道Samsung的题Leetcode bst max path-----is this solution correct?
这个题做的对吗?感觉leetcode的OJ有点太偏重DP了
cc150上面binary tree找所有sum==target的path,不一定从root出发Given a binary tree, find the maximum path sum
求教balanced binary tree的准确定义再来题目
相关话题的讨论汇总
话题: sum话题: tree话题: path话题: binary话题: 问道