1198. SubstringConstraintsTime Limit: 1 secs, Memory Limit: 32 MBDescriptionDr lee cuts a string S into N pieces,s[1],…,s[N].Now, Dr lee gives you the...
分类:
其他好文 时间:
2014-09-26 03:29:48
阅读次数:
253
suffix-array-for-longest-repeated-string
分类:
其他好文 时间:
2014-09-25 14:06:58
阅读次数:
178
function parseQueryString(url){ var obj={}; var keyvalue=[]; var key="",value=""; var paraString=url.substring(url.indexOf("?")+1,url.l...
分类:
Web程序 时间:
2014-09-25 13:45:08
阅读次数:
176
今天有幸去搜狗霸笔,有一题很有意思
String str1 = "test for sougou";
String str2 = str1.substring(5);
考点是str2是否生成新的字符数组来保存"for sougou"
当时我认为String内部是封装了一个char[],无法像cpp一样首地址加上一个数字来做到char[]的重用
新的字符串必须进行一次ArrayCop...
分类:
移动开发 时间:
2014-09-25 02:24:38
阅读次数:
241
declare 定义变量 set 为变量赋值SUBSTRING()函数SUBSTRING ( expression, start, length )expression 字符串、二进制字符串、文本、图像、列或包含列的表达式。请勿使用包含聚合函数的表达式。start 整数或可以隐式转换为 int 的表...
分类:
数据库 时间:
2014-09-24 20:31:47
阅读次数:
211
【求最大深度】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 leaf node.
这里说的最大深度是指最深叶子节点到根节点的路径长度
...
分类:
其他好文 时间:
2014-09-24 16:09:37
阅读次数:
200
字符串匹配的双重递归式写法
字符串的匹配有很高效的KMP、Sunday等算法,可供使用。下面使用的匹配算法本质上是朴素的,但它的双重递归式的写法仍然值得借鉴。...
分类:
其他好文 时间:
2014-09-24 13:19:46
阅读次数:
158
LIS(Longest Increasing Subsequence)最长上升(不下降)子序列,有两种算法复杂度为O(n*logn)和O(n^2)。在上述算法中,若使用朴素的顺序查找在 D1..Dlen查找,由于共有O(n)个元素需要计算,每次计算时的复杂度是O(n),则整个算法的时间复杂度为O(n...
分类:
其他好文 时间:
2014-09-24 08:14:46
阅读次数:
218
Given a string, find the length of the longest substring without repeating characters. For example, the longest substring without repeating letters fo...
分类:
编程语言 时间:
2014-09-22 23:29:43
阅读次数:
231
Longest Consecutive Sequence in an Unsorted Array
分类:
其他好文 时间:
2014-09-22 21:18:33
阅读次数:
124