码迷,mamicode.com
首页 >  
搜索关键字:longest substring    ( 5540个结果
·DP」知识点整理
一.最长公共子序列(LCS Longest Common Subsequence)第一,先说区别,最长公共子串和最长公共子序列是不一样的。最长公共子串不许是连续的,而最长公共子序列可以是不联系的。网络上解释的子序列:一个字符串S,去掉零个或者多个元素所剩下的子串称为S的子序列。最长公共子序列就是寻找...
分类:其他好文   时间:2014-05-10 01:12:20    阅读次数:370
09 变量重游
操作字符串${string: position :length} 取子串子串删除${string# substring} 从左边截掉第一个匹配的 substring${string## substring} 从左边截掉最后一个匹配的 substring${string% substring} 从右边...
分类:其他好文   时间:2014-05-09 03:59:36    阅读次数:244
Longest Valid Parentheses
Longest Valid Parentheses
分类:其他好文   时间:2014-05-08 21:00:03    阅读次数:282
Leetcode: Longest Common Prefix
这道题做的不够顺利,许多次通过,但是居然是卡在一个小问题上了,判断strs是否为空,我想当然地就写成了if(strs == null) return null; 报错java中null表示还没new出对象,就是还没开辟空间;“”表示new出了对象,但是这个对象装的是空字符串。这里显然是要应对strs...
分类:其他好文   时间:2014-05-08 15:16:16    阅读次数:291
leetcode第一刷_Longest Consecutive Sequence
给你一个数组,O(N)时间找出某些个数,这些题如果没见过,还真不是很好想。做了这些题,我觉得有下面两个个比较常见的思路: 1. 用两个指针,可以从一边开始,走某个距离停止,也可能是一头一尾两个指针,定义一种大小关系,他俩比较之后移动,直到相遇。 2. 用其他的辅助的数据结构,可能是hash表,可能是map,可能是栈或者队列。这种通常用在访问了现在的不能确定他们是不是有用,是不是能影响最后的结果...
分类:其他好文   时间:2014-05-07 07:50:33    阅读次数:392
【LeetCode OJ】Longest Consecutive Sequence
Problem Link:http://oj.leetcode.com/problems/longest-consecutive-sequence/This problem is a classical problem where we can reduce the running time by ...
分类:其他好文   时间:2014-05-05 22:55:22    阅读次数:552
UVA 10405 Longest Common Subsequence
最长公共子系列,简单的dp,不过注意有空格,所以,在读字符串的时候,尽量用gets读,这样基本没问题#include#include#include#includeusing namespace std;int dp[1001][1001];int MAX(int x,int y){ if (...
分类:其他好文   时间:2014-05-04 11:34:41    阅读次数:294
the longest distance of a binary tree
the longest distance of a binary tree 个人信息:就读于燕大本科软件工程专业 目前大三; 本人博客:google搜索“cqs_2012”即可; 个人爱好:酷爱数据结构和算法,希望将来从事算法工作为人民作出自己的贡献; 博客内容:the longest distance of a binary tree; 博客时间:2014-4-...
分类:其他好文   时间:2014-05-04 00:28:23    阅读次数:446
【LeetCode】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 concatenation of each word in L exactly once and without an...
分类:其他好文   时间:2014-05-03 21:35:49    阅读次数:310
queue for max elem, pop, push
queue for max elem, pop, push 个人信息:就读于燕大本科软件工程专业 目前大三; 本人博客:google搜索“cqs_2012”即可; 个人爱好:酷爱数据结构和算法,希望将来从事算法工作为人民作出自己的贡献; 博客内容:the longest distance of a binary tree; 博客时间:2014-4-15; 编...
分类:其他好文   时间:2014-05-03 17:13:09    阅读次数:406
5540条   上一页 1 ... 550 551 552 553 554 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!