上一页 1 2 3 4 5 6 ··· 11 下一页
方法一:直接使用备忘录 方法二:使用动态规划的方法 Read More
posted @ 2017-05-20 16:40 chengcy Views(102) Comments(0) Diggs(0) Edit
方法:使用深度遍历的方法,时间复杂度O(2^n) Read More
posted @ 2017-05-20 15:52 chengcy Views(105) Comments(0) Diggs(0) Edit
方法:使用递归的思想 这个问题与上一个问题的不同之处在于其在每个数字对应的字母中只能选择一个,这里的关键是对递归的过程有比较好的认识。 Read More
posted @ 2017-05-11 21:04 chengcy Views(104) Comments(0) Diggs(0) Edit
方法一:使用深度遍历的方式,时间复杂度O(n!) Read More
posted @ 2017-05-11 20:36 chengcy Views(127) Comments(0) Diggs(0) Edit
方法:采用递归的方式 或者使用查找的方式代替visit参数 对于Permutations II,只需判断现在访问到的数字与前一个是否相同即可。 Read More
posted @ 2017-05-07 15:30 chengcy Views(123) Comments(0) Diggs(0) Edit
方法:最简单的是使用subset的方法,然后去除重复即可,这里需要对原始的vector先进行排序 Read More
posted @ 2017-05-07 14:54 chengcy Views(107) Comments(0) Diggs(0) Edit
方法:使用一个vector记录数字是否被选中,惨痛的教训,不要把==写成=。。。。 Read More
posted @ 2017-05-07 14:35 chengcy Views(107) Comments(0) Diggs(0) Edit
方法:采用二分查找的方法,注意rt = rows*cols-1; Read More
posted @ 2017-05-07 10:33 chengcy Views(106) Comments(0) Diggs(0) Edit
方法:使用逼近的方法,先寻找左边边界,再找右边界,这与二分查找中边界的更新顺序相关 或者直接找到一个值后左右逼近即可。 Read More
posted @ 2017-05-06 12:33 chengcy Views(105) Comments(0) Diggs(0) Edit
方法:别弄反数字之间的位置关系就可以了 Read More
posted @ 2017-04-30 10:50 chengcy Views(103) Comments(0) Diggs(0) Edit
上一页 1 2 3 4 5 6 ··· 11 下一页