摘要: 【LeetCode】Minimum Depth of Binary TreeGiven a binary tree, find its minimum depth.The minimum depth is the number of nodes along the shortest path fro... 阅读全文
posted @ 2015-01-23 11:18 hitkb 阅读(218) 评论(0) 推荐(0) 编辑
摘要: 在Path SUm 1中(http://www.cnblogs.com/hitkb/p/4242822.html)我们采用栈的形式保存路径,每当找到符合的叶子节点,就将栈内元素输出。注意存在多条路径的情况。 public List> pathSum(TreeNode root, int sum) {... 阅读全文
posted @ 2015-01-23 10:07 hitkb 阅读(198) 评论(0) 推荐(0) 编辑