码迷,mamicode.com
首页 >  
搜索关键字:substring with conca    ( 3920个结果
poj 3693 Maximum repetition substring(后缀数组)
题目链接:poj 3693 Maximum repetition substring 题目大意:求一个字符串中循环子串次数最多的子串。 解题思路:对字符串构建后缀数组,然后枚举循环长度,分区间确定。对于一个长度l,每次求出i和i+l的LCP,那么以i为起点,循环子串长度为l的子串的循环次数为LCP/l+1,然后再考虑一下从i-l+1~i之间有没有存在增长的可能性。 #include ...
分类:其他好文   时间:2014-09-05 23:53:12    阅读次数:412
JS indexOf() lastIndexOf()与substring()截取字符串的区别
1.String.IndexOf 方法 (value[,startIndex])value:要查找的 Unicode 字符。 必选项startIndex:搜索起始位置。 可选项 不写从开头查找该方法返回一个整数值,指出 String 对象内子字符串的开始位置(如果没有设置第二个索引参数,从下标0开....
分类:Web程序   时间:2014-09-05 00:54:30    阅读次数:204
Javascript中让人迷惑的一些基本数据类型跟内置包装对象
数据类型跟对象的区别: 基本的数据类型是没有 属性 和 方法的,但是对象有;就像是java中的基本数据类型跟引用类型一样;看个例子:var s= " xxxx"var xxxx=s.substring(s.lastIndexOf(" ")+1,s.length);首先得明白在js中字符串可是基本类....
分类:编程语言   时间:2014-09-04 18:56:59    阅读次数:242
(3)JSTL的fn方法库
fn:functions,fn之所以称之为方法库,是因为fn使用不像core,fmt标签那样遵循的格式,而是遵循fn:methodName()的格式1、fn:contains(string, substring)如果参数string中包含参数substring,返回true。2、fn:contain...
分类:Web程序   时间:2014-09-04 18:28:29    阅读次数:288
Substring with Concatenation of All Words
You are given a string, S, and a list of words, L, that are all of the same length. Find all starting indices of substring(s) in S that is a concatena...
分类:其他好文   时间:2014-09-04 14:53:59    阅读次数:129
html历史
方法一:location.hash = 'abc'window.onhashchange = function(){}location.hash 返回结果 #abc => location.hash.substring(1) abc方法二:存历史:history.pushstate(数据,标题,网址...
分类:Web程序   时间:2014-09-03 22:36:17    阅读次数:278
Longest Valid Parentheses
Given a string containing just the characters '(' and ')', find the length of the longest valid (well-formed) parentheses substring.For "(()", the lon...
分类:其他好文   时间:2014-09-03 22:30:07    阅读次数:211
53. Minimum Window Substring
思路:涉及到2点: 1. Hash, 保证查找为 O(1). 2. S 中设置两指针,根据长度确定右边指针位置;根据若去掉该字符,则该字符在 window 中出现次数将小于在 T 中出现的次数确定左边指针位置。
分类:Windows程序   时间:2014-09-03 18:06:16    阅读次数:296
利用后缀数组(suffix array)求最长公共子串(longest common substring)
本文讨论了最长公共子串的的相关算法的时间复杂度,然后在后缀数组的基础上提出了一个时间复杂度为o(n^2*logn),空间复杂度为o(n)的算法。该算法虽然不及动态规划和后缀树算法的复杂度低,但其重要的优势在于可以编码简单,代码易于理解,适合快速实现。
分类:其他好文   时间:2014-09-03 16:26:16    阅读次数:309
一道题目
given a string ,return the longest substring that contains at most twocharacters.extern "C" char *SubStringWithAtMost2Chars(char * pStr, int len){ ...
分类:其他好文   时间:2014-09-03 14:29:36    阅读次数:211
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!