会员
众包
新闻
博问
AI培训
云市场
所有博客
当前博客
我的博客
我的园子
账号设置
简洁模式
...
退出登录
注册
登录
xpp
CnBlogs
Home
New Post
Contact
Admin
Subscription
上一页
1
2
3
4
5
6
···
11
下一页
2017年5月20日
Unique Paths
方法一:直接使用备忘录 方法二:使用动态规划的方法
Read More
posted @ 2017-05-20 16:40 chengcy
Views(102)
Comments(0)
Diggs(0)
Edit
Palindrome Partitioning
方法:使用深度遍历的方法,时间复杂度O(2^n)
Read More
posted @ 2017-05-20 15:52 chengcy
Views(105)
Comments(0)
Diggs(0)
Edit
2017年5月11日
Letter Combinations of a Phone Number
方法:使用递归的思想 这个问题与上一个问题的不同之处在于其在每个数字对应的字母中只能选择一个,这里的关键是对递归的过程有比较好的认识。
Read More
posted @ 2017-05-11 21:04 chengcy
Views(104)
Comments(0)
Diggs(0)
Edit
Combinations
方法一:使用深度遍历的方式,时间复杂度O(n!)
Read More
posted @ 2017-05-11 20:36 chengcy
Views(127)
Comments(0)
Diggs(0)
Edit
2017年5月7日
Permutations / Permutations II
方法:采用递归的方式 或者使用查找的方式代替visit参数 对于Permutations II,只需判断现在访问到的数字与前一个是否相同即可。
Read More
posted @ 2017-05-07 15:30 chengcy
Views(123)
Comments(0)
Diggs(0)
Edit
Subsets II
方法:最简单的是使用subset的方法,然后去除重复即可,这里需要对原始的vector先进行排序
Read More
posted @ 2017-05-07 14:54 chengcy
Views(107)
Comments(0)
Diggs(0)
Edit
Subsets
方法:使用一个vector记录数字是否被选中,惨痛的教训,不要把==写成=。。。。
Read More
posted @ 2017-05-07 14:35 chengcy
Views(107)
Comments(0)
Diggs(0)
Edit
Search a 2D Matrix
方法:采用二分查找的方法,注意rt = rows*cols-1;
Read More
posted @ 2017-05-07 10:33 chengcy
Views(106)
Comments(0)
Diggs(0)
Edit
2017年5月6日
Search for a Range
方法:使用逼近的方法,先寻找左边边界,再找右边界,这与二分查找中边界的更新顺序相关 或者直接找到一个值后左右逼近即可。
Read More
posted @ 2017-05-06 12:33 chengcy
Views(105)
Comments(0)
Diggs(0)
Edit
2017年4月30日
Evaluate Reverse Polish Notation
方法:别弄反数字之间的位置关系就可以了
Read More
posted @ 2017-04-30 10:50 chengcy
Views(103)
Comments(0)
Diggs(0)
Edit
上一页
1
2
3
4
5
6
···
11
下一页
公告