上一页 1 ··· 12 13 14 15 16 17 18 19 20 ··· 28 下一页
摘要: Given numRows, generate the first numRows of Pascal's triangle. For example, given numRows = 5,Return[ [1], [1,1], [1,2,1], [1,3,3,1], [1,4,... 阅读全文
posted @ 2015-05-24 16:50 TonyLuis 阅读(201) 评论(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-05-24 16:26 TonyLuis 阅读(218) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree struct TreeLinkNode { TreeLinkNode *left; TreeLinkNode *right; TreeLinkNode *next; }Populate each next pointe... 阅读全文
posted @ 2015-05-24 12:12 TonyLuis 阅读(146) 评论(0) 推荐(0) 编辑
摘要: Given a string S and a string T, count the number of distinct subsequences of T in S.A subsequence of a string is a new string which is formed from th... 阅读全文
posted @ 2015-05-24 11:55 TonyLuis 阅读(276) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree, flatten it to a linked list in-place. For example,Given 1 / \ 2 5 / \ \ 3 4 6The flattened ... 阅读全文
posted @ 2015-05-23 21:34 TonyLuis 阅读(130) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree and a sum, find all root-to-leaf paths where each path's sum equals the given sum.For example:Given the below binary tree and sum ... 阅读全文
posted @ 2015-05-23 20:55 TonyLuis 阅读(443) 评论(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-05-23 20:03 TonyLuis 阅读(151) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree, find its minimum depth.The minimum depth is the number of nodes along the shortest path from the root node down to the nearest le... 阅读全文
posted @ 2015-05-23 19:58 TonyLuis 阅读(156) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree, determine if it is height-balanced.For this problem, a height-balanced binary tree is defined as a binary tree in which the depth... 阅读全文
posted @ 2015-05-23 19:48 TonyLuis 阅读(743) 评论(0) 推荐(0) 编辑
摘要: Given a singly linked list where elements are sorted in ascending order, convert it to a height balanced BST.解题思路:同上题,JAVA实现如下: public TreeNode sor... 阅读全文
posted @ 2015-05-23 19:47 TonyLuis 阅读(201) 评论(0) 推荐(0) 编辑
上一页 1 ··· 12 13 14 15 16 17 18 19 20 ··· 28 下一页