摘要: Problem Description: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 equ... 阅读全文
posted @ 2014-06-28 15:50 HaruHaru 阅读(128) 评论(0) 推荐(0) 编辑
摘要: Problem Description:Given a binary tree, flatten it to a linked list in-place.Solution:对二叉树进行前序遍历(pre-order). 1 public void flatten(TreeNode root) { 2... 阅读全文
posted @ 2014-06-28 15:12 HaruHaru 阅读(128) 评论(0) 推荐(0) 编辑
摘要: Problem Desciption : Given a stringSand a stringT, count the number of distinct subsequences ofTinS.A subsequence of a string is a new string which is... 阅读全文
posted @ 2014-06-28 14:44 HaruHaru 阅读(176) 评论(0) 推荐(0) 编辑