
DP
不刷脸皮要刷题
这个作者很懒,什么都没留下…
展开
-
Combination Sum I, II
public class Solution { public List> combinationSum(int[] candidates, int target) { if (candidates == null || candidates.length == 0) { return null; } Arrays.so转载 2014-11-11 23:48:00 · 252 阅读 · 0 评论 -
DP啊DP
1, Given a list of N coins, their values (V1, V2, ... , VN), and the total sum S. Find the minimum number of coins the sum of which is S (we can use as many coins of one type as we want), or r转载 2014-10-05 00:38:37 · 290 阅读 · 0 评论 -
Word Break II
枚举的题,一般用DFS+Backtracking做,此题会超时,那么要辅助memoization, 保存之前得到的结果.怎么mem?1,借鉴word break I, 保存能否该index之后能否break: boolean[s.length() + 1]2, 保存详细的分法结果: HashMap>public class Solution { List res =转载 2014-10-04 03:19:24 · 391 阅读 · 0 评论 -
Longest Palindromic Substring
public class Solution { public String longestPalindrome(String s) { if (s == null) return null; int max = 0; String maxSub = ""; for (int beg = 0; beg < s.length();转载 2014-10-03 09:13:00 · 274 阅读 · 0 评论 -
Edit distance - 改进算法待做!
Given two words word1 and word2, find the minimum number of steps required to convert word1 to word2. (each operation is counted as 1 step.)You have the following 3 operations permitted on a word:转载 2014-10-09 20:51:26 · 388 阅读 · 0 评论 -
Word Break I
1, recursion2, recursion + memoization3, DP转载 2014-10-03 23:31:03 · 367 阅读 · 0 评论 -
Maximum Product Subarray
最值问题的第二种思路,保存局部最优,更新全局最优求P转载 2014-10-19 20:53:57 · 240 阅读 · 0 评论 -
Interleaving String
先保存一下 某个大神的DP专辑:http://www.cnblogs.com/remlostime/tag/DP/转载 2014-10-19 21:26:55 · 304 阅读 · 0 评论