题目: Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses. For example, given n = 3, a solution set i ...
分类:
其他好文 时间:
2017-05-07 23:04:35
阅读次数:
112
题目: Given a collection of candidate numbers (C) and a target number (T), find all unique combinations in C where the candidate numbers sums to T. Each ...
分类:
其他好文 时间:
2017-05-07 22:03:07
阅读次数:
231
【题目】 Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses. For example, given n = 3, a solution set ...
分类:
其他好文 时间:
2017-05-06 14:12:06
阅读次数:
214
Given a string containing only digits, restore it by returning all possible valid IP address combinations. For example: Given "25525511135", return [" ...
分类:
其他好文 时间:
2017-05-05 10:52:49
阅读次数:
93
problem: Given a digit string, return all possible letter combinations that the number could represent. A mapping of digit to letters (just like on th ...
分类:
其他好文 时间:
2017-04-28 10:31:21
阅读次数:
199
生成组合数是初中的知识,没有人不知道。组合数学我觉得是最有意思的数学分支,室友应该是这方面的专家,他的纸牌问题我听都听不懂。。 不知道你们是什么感觉。我以看到组合数,立即会想到全排列。这可能是由于当时初中的时候。这两部分知识是放在一起讲的。也确实有一些联系。如何生成全排列算法课在递归的那部分讲过,写 ...
分类:
其他好文 时间:
2017-04-18 09:27:11
阅读次数:
146
题目: Given a collection of candidate numbers (C) and a target number (T), find all unique combinations in C where the candidate numbers sums to T. Each ...
分类:
其他好文 时间:
2017-04-15 12:06:55
阅读次数:
169
题目: Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses. For example, given n = 3, a solution set i ...
分类:
其他好文 时间:
2017-04-13 00:23:03
阅读次数:
266
题目: Combinations 1-n个数字中找k个数字的所有不同组合。 思路:从1-k开始,每次从k开始,让最后面的元素加1,超过了,就让前面一个元素加1,后面一个元素变为前面一个元素的值加1. 循环知道所有元素都没有超过,则是一种不同的情况。 例如:n = 6,k = 4; 1234->123 ...
分类:
其他好文 时间:
2017-04-09 16:54:21
阅读次数:
131
将电话号码的组合转换称所有可能的字母组合。 思路: 首先将电话键盘中的0->9的数字对应的字母集合放到一个常量二维数组中便于搜索。 [ [' ']//0 []//1 ['a','b','c']//2 ... ['w','x','y','z']//9 ] 然后递归搜索每一位给定的数字对应的字母数组,一 ...
分类:
其他好文 时间:
2017-04-05 01:28:44
阅读次数:
250