摘要: 题目:Given a collection of integers that might contain duplicates, S, return all possible subsets.Note:Elements in a subset must be in non-descending o... 阅读全文
posted @ 2014-07-31 08:09 爱做饭的小莹子 阅读(3253) 评论(0) 推荐(0) 编辑
摘要: 题目:Given a set of distinct integers, S, return all possible subsets.Note:Elements in a subset must be in non-descending order.The solution set must n... 阅读全文
posted @ 2014-07-31 04:21 爱做饭的小莹子 阅读(4658) 评论(0) 推荐(0) 编辑
摘要: 题目:Given a digit string, return all possible letter combinations that the number could represent.A mapping of digit to letters (just like on the tele... 阅读全文
posted @ 2014-07-31 03:57 爱做饭的小莹子 阅读(3463) 评论(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 ... 阅读全文
posted @ 2014-07-31 03:21 爱做饭的小莹子 阅读(3453) 评论(1) 推荐(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 su... 阅读全文
posted @ 2014-07-31 02:43 爱做饭的小莹子 阅读(3028) 评论(0) 推荐(1) 编辑
摘要: 题目: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 d... 阅读全文
posted @ 2014-07-31 02:35 爱做饭的小莹子 阅读(2030) 评论(0) 推荐(0) 编辑
摘要: 题目:Given an array where elements are sorted in ascending order, convert it to a height balanced BST.题解:先复习下什么是二叉搜索树(引自Wikipedia):二叉查找树(Binary Search ... 阅读全文
posted @ 2014-07-31 02:28 爱做饭的小莹子 阅读(3288) 评论(0) 推荐(1) 编辑
摘要: 题目: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 neares... 阅读全文
posted @ 2014-07-31 00:47 爱做饭的小莹子 阅读(3145) 评论(0) 推荐(0) 编辑
摘要: 题目:Given a binary tree, find its maximum depth.The maximum depth is the number of nodes along the longest path from the root node down to the farthes... 阅读全文
posted @ 2014-07-31 00:25 爱做饭的小莹子 阅读(2346) 评论(0) 推荐(0) 编辑
摘要: 题目:Given a binary tree, check whether it is a mirror of itself (ie, symmetric around its center).For example, this binary tree is symmetric: 1 /... 阅读全文
posted @ 2014-07-31 00:05 爱做饭的小莹子 阅读(3194) 评论(0) 推荐(0) 编辑