该文被密码保护。 阅读全文
posted @ 2015-09-17 03:41 茜茜的技术空间 阅读(1) 评论(0) 推荐(0)
摘要: Given a binary tree, return all root-to-leaf paths.For example, given the following binary tree: 1 / \2 3 \ 5All root-to-leaf paths are:["1->... 阅读全文
posted @ 2015-09-17 02:52 茜茜的技术空间 阅读(153) 评论(0) 推荐(0)
摘要: Given a binary tree, find the lowest common ancestor (LCA) of two given nodes in the tree.According to thedefinition of LCA on Wikipedia: “The lowest ... 阅读全文
posted @ 2015-09-17 01:53 茜茜的技术空间 阅读(1186) 评论(0) 推荐(0)
摘要: Given a binary search tree (BST), find the lowest common ancestor (LCA) of two given nodes in the BST.According to thedefinition of LCA on Wikipedia: ... 阅读全文
posted @ 2015-09-17 00:54 茜茜的技术空间 阅读(142) 评论(0) 推荐(0)
摘要: 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.Fo... 阅读全文
posted @ 2015-09-17 00:11 茜茜的技术空间 阅读(140) 评论(0) 推荐(0)