上一页 1 ··· 5 6 7 8 9 10 11 12 13 ··· 18 下一页
摘要: 题目:Given a singly linked list where elements are sorted in ascending order, convert it to a height balanced BST.题解:之前做过一道是从sorted array转换到BinarySearc... 阅读全文
posted @ 2014-08-01 04:25 爱做饭的小莹子 阅读(2988) 评论(1) 推荐(0) 编辑
摘要: 题目: Given n, generate all structurally unique BST's (binary search trees) that store values 1...n.For example,Given n = 3, your program should return... 阅读全文
posted @ 2014-08-01 03:47 爱做饭的小莹子 阅读(5564) 评论(0) 推荐(0) 编辑
摘要: 下面应用转自Wikipedia(http://zh.wikipedia.org/wiki/%E5%8D%A1%E5%A1%94%E5%85%B0%E6%95%B0):组合数学中有非常多的组合结构可以用卡塔兰数来计数。在Richard P. Stanley的Enumerative Combinato... 阅读全文
posted @ 2014-08-01 03:03 爱做饭的小莹子 阅读(904) 评论(0) 推荐(0) 编辑
摘要: 题目:Given n, how many structurally unique BST's (binary search trees) that store values 1...n?For example,Given n = 3, there are a total of 5 unique B... 阅读全文
posted @ 2014-08-01 02:58 爱做饭的小莹子 阅读(5130) 评论(4) 推荐(0) 编辑
摘要: 题目:Given a 2D board and a word, find if the word exists in the grid.The word can be constructed from letters of sequentially adjacent cell, where "ad... 阅读全文
posted @ 2014-08-01 02:06 爱做饭的小莹子 阅读(5068) 评论(0) 推荐(0) 编辑
摘要: 题目: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) 编辑
上一页 1 ··· 5 6 7 8 9 10 11 12 13 ··· 18 下一页