上一页 1 2 3 4 5 6 7 8 9 ··· 22 下一页
摘要: Given a binary tree containing digits from0-9only, each root-to-leaf path could represent a number.An example is the root-to-leaf path1->2->3which rep... 阅读全文
posted @ 2015-06-11 04:03 世界到处都是小星星 阅读(154) 评论(0) 推荐(0) 编辑
摘要: 乍一看还真以为和1 一样,呵呵当然不是啦Given two words (startandend), and a dictionary, find all shortest transformation sequence(s) fromstarttoend, such that:Only one l... 阅读全文
posted @ 2015-06-11 03:00 世界到处都是小星星 阅读(115) 评论(0) 推荐(0) 编辑
摘要: 还是参考爱做饭同学http://www.cnblogs.com/springfor/p/3893499.htmlGiven two words (beginWordandendWord), and a dictionary, find the length of shortest transform... 阅读全文
posted @ 2015-06-11 00:55 世界到处都是小星星 阅读(293) 评论(0) 推荐(0) 编辑
摘要: 基础但是要掌握 int a = 'A'这种写法,以及s.trim(); s = s.toUpperCase();public class Solution { public boolean isPalindrome(String s) { if(s==null ||... 阅读全文
posted @ 2015-06-10 11:04 世界到处都是小星星 阅读(154) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree, find the maximum path sum.The path may start and end at any node in the tree.For example:Given the below binary tree, 1 ... 阅读全文
posted @ 2015-06-10 10:48 世界到处都是小星星 阅读(130) 评论(0) 推荐(0) 编辑
摘要: Follow up for problem "Populating Next Right Pointers in Each Node".What if the given tree could be any binary tree? Would your previous solution stil... 阅读全文
posted @ 2015-06-10 10:34 世界到处都是小星星 阅读(117) 评论(0) 推荐(0) 编辑
摘要: Given a stringSand a stringT, count the number of distinct subsequences ofTinS.A subsequence of a string is a new string which is formed from the orig... 阅读全文
posted @ 2015-06-10 07:26 世界到处都是小星星 阅读(141) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree, flatten it to a linked list in-place.For example,Given 1 / \ 2 5 / \ \ 3 4 6The flattened t... 阅读全文
posted @ 2015-06-10 06:35 世界到处都是小星星 阅读(148) 评论(0) 推荐(0) 编辑
摘要: 就recursive做,简单题public class Solution { public int minDepth(TreeNode root) { if(root==null) return 0; if (root.left==null && root.righ... 阅读全文
posted @ 2015-06-10 06:14 世界到处都是小星星 阅读(151) 评论(0) 推荐(0) 编辑
摘要: 简单题IGiven 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 su... 阅读全文
posted @ 2015-06-10 06:02 世界到处都是小星星 阅读(208) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 9 ··· 22 下一页