DP Solution similar to Longest Increasing Subsequence: 我的解法:用一个arraylist存以某一个element结尾的最长sequence 别人的好方法,大体思路一样,只是不存arraylist, 而用一个preIndex数组存以某一个elem ...
分类:
其他好文 时间:
2016-11-27 07:45:52
阅读次数:
177
<!DOCTYPE html><html> <head> <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"> <meta charset ...
分类:
其他好文 时间:
2016-11-27 00:08:15
阅读次数:
202
LCS问题即longest common subsequence problem,中文:最长公共子序列问题 给你两个字符串str1和str2,它们之间可能存在公有子序列,子序列和子串的区别是:子序列不要求连续,只需要按照顺序出现就好,子串则要求连续: 例如:SIMPLE和NAIVE有共同的子序列IE ...
分类:
其他好文 时间:
2016-11-26 23:20:09
阅读次数:
328
Problem Description You have a sequence {a1,a2,...,an} and you can delete a contiguous subsequence of length m. So what is the minimum number of inver ...
分类:
编程语言 时间:
2016-11-26 23:16:30
阅读次数:
271
http://www.skorks.com/2009/09/bash-shortcuts-for-maximum-productivity/ Bash Shortcuts For Maximum Productivity September 15, 2009 By Alan Skorkin 71 C ...
分类:
其他好文 时间:
2016-11-26 17:11:04
阅读次数:
205
Say you have an array for which the ith element is the price of a given stock on day i. Design an algorithm to find the maximum profit. You may comple ...
分类:
其他好文 时间:
2016-11-26 02:46:16
阅读次数:
171
How do I increase the maximum number of open files under CentOS Linux? How do I open more file descriptors under Linux? The ulimit command provides co ...
分类:
系统相关 时间:
2016-11-25 17:13:55
阅读次数:
235
O(N^2)解法: DP dp[i] represent the maximum product of breaking up integer i O(N)解法: the best factor is 3. we keep breaking n into 3's until n gets small ...
分类:
其他好文 时间:
2016-11-24 09:29:32
阅读次数:
202
Say you have an array for which the ith element is the price of a given stock on day i. (Easy) Design an algorithm to find the maximum profit. You may ...
分类:
其他好文 时间:
2016-11-24 07:27:52
阅读次数:
205