码迷,mamicode.com
首页 >  
搜索关键字:longest    ( 2697个结果
LintCode-Longest Increasing Subsequence
Given a sequence of integers, find the longest increasing subsequence (LIS).You code should return the length of the LIS.ExampleFor [5, 4, 1, 2, 3], t...
分类:其他好文   时间:2014-12-29 06:31:53    阅读次数:131
L【leetcode】ongest Palindromic Substring
Longest Palindromic SubstringGiven a stringS, find the longest palindromic substring inS. You may assume that the maximum length ofSis 1000, and there...
分类:其他好文   时间:2014-12-28 23:38:24    阅读次数:271
【LeetCode】Longest Substring with At Most Two Distinct Characters (2 solutions)
Longest Substring with At Most Two Distinct CharactersGiven a string, find the length of the longest substring T that contains at most 2 distinct char...
分类:其他好文   时间:2014-12-28 16:53:21    阅读次数:198
Leetcode:Longest Substring Without Repeating Characters 解题报告
Longest Substring Without Repeating CharactersGiven a string, find the length of the longest substring without repeating characters. For example, the ...
分类:其他好文   时间:2014-12-27 20:14:16    阅读次数:214
Leetcode:【DP】Longest Palindromic Substring 解题报告
Longest Palindromic Substring-- HARD 级别Question SolutionGiven a string S, find the longest palindromic substring in S. You may assume that the maximum...
分类:其他好文   时间:2014-12-27 20:12:16    阅读次数:136
Longest Substring Without Repeating Characters
Longest Substring Without Repeating CharactersGiven a string, find the length of the longest substring without repeating characters. For example, the ...
分类:其他好文   时间:2014-12-26 20:14:20    阅读次数:156
第四届河南省程序设计大赛 - 部分题解
Substring 时间限制:1000 ms  |  内存限制:65535 KB 难度:1 描述 You are given a string input. You are to find the longest substring of input such that the reversal of the substring is also a substrin...
分类:其他好文   时间:2014-12-26 14:40:43    阅读次数:236
《github一天一道算法题》:动态规划法解决最长公共子序列(LCS)问题的最简单方法
/* * copyleft@hustyangju * 问题:longest common subsequece problem * 思路:从底往上,利用动态规划,划分子问题,利用LCS子问题的长度变化,求得LCS * 时间复杂度O(m*n) * 空间复杂度O(m*n) */ #include #include using namespace std; class lcs { p...
分类:编程语言   时间:2014-12-26 13:01:52    阅读次数:468
leetcode Longest Substring with At Most Two Distinct Characters
找到最多含有两个不同字符的子串的最长长度。例如:eoeabc,最长的是eoe为3,其他都为2.思路:用p1,p2表示两种字符串的最后一个出现的下标位置。初始p1为0. p2为-1.start初始化为0,表示两种字符串的开头。只要遍历一次string就可以得到结果了。首先我们要确定p2的值,那么i要一...
分类:其他好文   时间:2014-12-25 21:47:44    阅读次数:150
[leetcode] Longest Palindromic Substring
题目:(String)Given a stringS, find the longest palindromic substring inS. You may assume that the maximum length ofSis 1000, and there exists one unique...
分类:其他好文   时间:2014-12-25 06:34:06    阅读次数:198
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!