public static String lcs(String a, String b){ int aLen = a.length(); int bLen = b.length(); if(aLen==0 || bLen==0) return ""; if(a.char...
分类:
其他好文 时间:
2014-07-22 22:49:15
阅读次数:
194
函数描述fn:contains(string, substring)如果参数string中包含参数substring,返回truefn:containsIgnoreCase(string, substring)如果参数string中包含参数substring(忽略大小写),返回truefn:ends...
分类:
Web程序 时间:
2014-07-22 22:40:12
阅读次数:
225
Common Substrings
Time Limit: 5000MS
Memory Limit: 65536K
Total Submissions: 7082
Accepted: 2355
Description
A substring of a string T is defined as:
T(i, k)=TiTi+...
分类:
其他好文 时间:
2014-07-22 14:27:08
阅读次数:
314
sql替换法:declare @myStr nvarchar(500);set @myStr='oa_20121026new.bak<';select replace(@myStr,substring(@myStr,charindex('<',@myStr),len(@myStr)),'');
分类:
数据库 时间:
2014-07-22 00:32:35
阅读次数:
221
Write a function to find the longest common prefix string amongst an array of strings.题解:以strs[0]为模板,每次挨个查看是否所有的串里面是否第i位上都和strs[0]一样,如果都一样,把i位置上的字符放到a...
分类:
其他好文 时间:
2014-07-21 23:31:00
阅读次数:
267
Maximum repetition substring
Time Limit: 1000MS
Memory Limit: 65536K
Total Submissions: 6638
Accepted: 2007
Description
The repetition number of a string is defined a...
分类:
其他好文 时间:
2014-07-21 11:35:34
阅读次数:
244
题目链接 Write a function to find the longest common prefix string amongst an array of strings. 题目的意思说的不是很清楚,开始理解成了求任意两个字符串的前缀中的最长者。但是本题的意思是求所有字符串的最长公共前缀,...
分类:
其他好文 时间:
2014-07-21 09:14:25
阅读次数:
225
Given a binary tree, find its maximum depth.The maximum depth is the number of nodes along the longest path from the root node down to the farthest le...
分类:
其他好文 时间:
2014-07-21 09:07:24
阅读次数:
207
substr()和substring()方法可用来从字符串中提取一个子串,并赋予另一个变量,或者用在表达式中。这两个方法返回的结果相同,都是子串,但它们需要的参数不同。substring()方法接受两个参数:子串的开始位置和子串中最后一个字符后面的字符位置。第二个参数是可选的,如果不包含它,则子串包...
分类:
其他好文 时间:
2014-07-21 08:27:35
阅读次数:
511
最长上升子序列问题 代码(C)本文地址: http://blog.csdn.net/caroline_wendy题目: 有一个长为n的数列a. 请求出这个序列中最长上升子序列的长度. 最长上升子序列的数字之间可以有间隔.即最长上升子序列(LIS, Longest Increasing Subsequence), 例如: n=5, a={4,2,3,1,5}, result=3(2,3,5).使用动...
分类:
其他好文 时间:
2014-07-20 22:34:43
阅读次数:
297