01 2015 档案

摘要:【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 阅读(232) 评论(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 阅读(210) 评论(0) 推荐(0)
摘要:Path Sum 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 giv... 阅读全文
posted @ 2015-01-22 22:01 hitkb 阅读(486) 评论(0) 推荐(0)
摘要:随笔一记,留做重温!Flatten Binary Tree to Linked ListGiven a binary tree, flatten it to a linked list in-place. For example,Given 1 / \ 2 ... 阅读全文
posted @ 2015-01-22 17:10 hitkb 阅读(120) 评论(0) 推荐(0)