
二叉树
文章平均质量分 70
yiayia070614
在阿里做苹果业务
展开
-
LeetCode 112&113 --Path Sum I & II;
Path Sum I 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 tr原创 2016-09-11 13:37:04 · 216 阅读 · 0 评论 -
Leetcode 257 -- Binary Tree Paths
Given a binary tree, return all root-to-leaf paths. For example, given the following binary tree: 1 / \ 2 3 \ 5 All root-to-leaf paths are: ["1->2->5", "1->3"] 解法:原创 2016-09-11 14:52:55 · 185 阅读 · 0 评论