码迷,mamicode.com
首页 >  
搜索关键字:longest substring    ( 5540个结果
Longest Palindromic Substring
Description:Given a stringS, find the longest palindromic substring inS. You may assume that the maximum length ofSis 1000, and there exists one uniqu...
分类:其他好文   时间:2015-09-02 15:57:57    阅读次数:218
LIS && LCS && LCIS模板
1. LISO (n^2):/* LIS(Longest Increasing Subsequence) 最长上升子序列 O (n ^ 2) 状态转移方程:dp[i] = max (dp[j]) + 1 (a[j] res; int i; for (i=pos[len]; ~fa[i]; i=fa....
分类:其他好文   时间:2015-09-02 13:43:44    阅读次数:157
【Leetcode】【Medium】Palindrome Partitioning
Given a strings, partitionssuch that every substring of the partition is a palindrome.Return all possible palindrome partitioning ofs.For example, giv...
分类:其他好文   时间:2015-09-02 00:28:43    阅读次数:214
LeetCode 5 Longest Palindromic Substring manacher算法,最长回文子序列,string.substr(start,len) 难度:2
https://leetcode.com/problems/longest-palindromic-substring/manacher算法相关:http://blog.csdn.net/ywhorizen/article/details/6629268class Solution {public:...
分类:编程语言   时间:2015-09-01 21:33:57    阅读次数:168
String对象
charAt( index i) //返回指定位置的字符串substring(start ,end) //方法返回位于String对象中指定位置的子字符串。indexOf(str,start)//方法放回String对象内第一次出现子字符串位置。如果没有找到子字符串,则返回-1例如: 0123456...
分类:其他好文   时间:2015-09-01 21:10:02    阅读次数:232
LeetCode 5 Longest Palindromic Substring 最长回文子序列 manacher算法 string.substr 难度:2
https://leetcode.com/problems/longest-palindromic-substring/manacher算法:http://blog.csdn.net/ywhorizen/article/details/6629268string longestPalindrome(...
分类:编程语言   时间:2015-09-01 18:28:26    阅读次数:131
Longest Common Prefix
Description:Write a function to find the longest common prefix string amongst an array of strings.(最长公共字串)Code:string merge(string&str1, string&str2) ...
分类:其他好文   时间:2015-09-01 12:25:02    阅读次数:171
SPOJ Longest Common Substring II
Longest Common Substring IITime Limit: 2000msMemory Limit: 262144KBThis problem will be judged onSPOJ. Original ID:LCS264-bit integer IO format:%lld J...
分类:其他好文   时间:2015-09-01 10:26:26    阅读次数:219
leetcode3 ongest Substring Without Repeating Characters
刚开始还尼玛各种优化,怕n*n的时间复杂度还通不过,再想能不能简化一下,最后发现暴力破解直接AC,我太高估它了...... 题意就是给你一个字符串,求出这个字符串的最长子串,但是这个子串是有规则的,就是不能有重复的字符,我是从第一个字符开始遍历到最后一个字符,因为最长的子串一定是以其中一个字符为开头,我逐个统计一遍最长子串就OK了,其实刚才我有想了一下,这个其实也不是n*n的时间复杂度,因为字符...
分类:其他好文   时间:2015-09-01 06:57:33    阅读次数:187
动态规划5-最长单增子序列
(LIS Longest Increasing Subsequence)给定一个数列,从中删掉任意若干项剩余的序列叫做它的一个子序列,求它的最长的子序列,满足子序列中的元素是单调递增的。例如给定序列{1,6,3,5,4},答案是3,因为{1,3,4}和{1,5,4}就是长度最长的两个单增子序列。处看...
分类:其他好文   时间:2015-08-31 17:09:00    阅读次数:254
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!