Path Sum
2015-09-11 17:53
225 查看
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 = 22,
return true, as there exist a root-to-leaf path 5->4->11->2 which sum is 22.
For example:
Given the below binary tree and sum = 22,
5 / \ 4 8 / / \ 11 13 4 / \ \ 7 2 1
return true, as there exist a root-to-leaf path 5->4->11->2 which sum is 22.
相关文章推荐
- Path Sum II
- 高并发请求解决方案
- 【移动开发】Android应用程序中实用的代码框架(二)
- 【移动开发】Android应用程序中实用的代码框架(二)
- 函数应用-web_add_filter
- maven依赖包版本冲突小尝试
- U8SDK问答及汇总
- Android Fragment生命周期
- Maximum Depth of Binary Tree
- 消息中间件
- ASP.NET 5 Beta7发布
- java 内存区域中的栈
- 手机蓝牙
- 使用Azure构建“鹰眼”容器平台
- return 0
- android studio给项目添加第三方库的方法
- 老式后门之美:五种复古远程控制工具(含下载)
- jquery的jquery c.browser msie undefined的问题解决办法
- 【C++基金会 06】explictkeyword
- 结构体