Given a string S, find the longest palindromic
substring in S. You may assume that the maximum length of S is 1000, and there
exists one unique longes...
分类:
其他好文 时间:
2014-05-16 21:15:37
阅读次数:
454
模板题,找来测代码。注意有相同单词//#pragma comment(linker,
"/STACK:1024000000,1024000000")#include#include#include#include#include#include#include#include#include#inc...
分类:
其他好文 时间:
2014-05-16 05:45:11
阅读次数:
403
Given a string, find the length of the longest
substring without repeating characters. For example, the longest substring
without repeating letters fo...
分类:
其他好文 时间:
2014-05-15 17:50:38
阅读次数:
298
字符串连接误用 错误的写法:String s = ""; for (Person p :
persons) { s += ", " + p.getName(); } s = s.substring(2); //remove first comma
正确的写法:StringBuilde...
分类:
编程语言 时间:
2014-05-15 17:38:49
阅读次数:
493
问题描述
最长递增子序列也称 “最长上升子序列”,简称LIS ( longest increasing subsequence)。设L=是n个不同的实数的序列,L的递增子序列是这样一个子序列Lis=,其中k1
如:求一个一维数组arr[i]中的最长递增子序列的长度,如在序列{ 7, 1, 6, 5, 3, 4, 8 }中,最长递增子序列长度为4,其递增子序列为:1,3,4,8。...
分类:
其他好文 时间:
2014-05-15 15:06:59
阅读次数:
328
【题目】
Given a string, find the length of the longest substring without repeating characters. For example, the longest substring without repeating letters for "abcabcbb" is "abc", which the length is 3. For "bbbbb" the longest substring is "b", with the len...
分类:
其他好文 时间:
2014-05-15 14:40:14
阅读次数:
320
1 function preview(oper) { 2 if (oper "; //设置打印开始区域
5 eprnstr = ""; //设置打印结束区域 6 prnhtml = bdhtml.substring(bdhtm...
分类:
编程语言 时间:
2014-05-15 14:31:49
阅读次数:
485
Longest Common Prefix
Write a function to find the longest common prefix string amongst an array of strings....
分类:
其他好文 时间:
2014-05-15 13:27:07
阅读次数:
233
【题目】
Given a string S, find the longest palindromic substring in S. You may assume that the maximum length of S is 1000, and there exists one unique longest palindromic substring.
【题意】
题意是找出字符串S中最长回文子串,S最长为1000,保证有唯一解
【思路】
原字符串用特殊字符#间隔,如下所示:
#a...
分类:
其他好文 时间:
2014-05-15 03:31:25
阅读次数:
299
题目一:
Given a string s, partition s such that every substring of the partition is a palindrome.
Return all possible palindrome partitioning of s.
For example, given s = "aab",
Return
[
...
分类:
其他好文 时间:
2014-05-14 15:10:01
阅读次数:
293