码迷,mamicode.com
首页 >  
搜索关键字:longest    ( 2697个结果
LeetCode Longest Consecutive Sequence
Given an unsorted array of integers, find the length of the longest consecutive elements sequence.For example,Given[100, 4, 200, 1, 3, 2],The longest ...
分类:其他好文   时间:2014-12-10 01:41:06    阅读次数:194
Leetcode: Longest Palindromic Substring
Given a stringS, find the longest palindromic substring inS. You may assume that the maximum length ofSis 1000, and there exists one unique longest pa...
分类:其他好文   时间:2014-12-09 13:44:16    阅读次数:210
Leetcode: Longest Common Prefix
Write a function to find the longest common prefix string amongst an array of strings.分析:这道题没什么好方法,暴力搜索比较即可,在用C++实现时有一个小trick就是"Ifposis equal to thest...
分类:其他好文   时间:2014-12-09 13:42:01    阅读次数:143
[leetcode]Longest Palindromic Substring
问题描述: 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. 基本思想: 本题的navi...
分类:其他好文   时间:2014-12-08 23:04:00    阅读次数:221
Leetcode: Longest Substring Without Repeating Characters
Given a string, find the length of the longest substring without repeating characters. For example, the longest substring without repeating letters fo...
分类:其他好文   时间:2014-12-08 21:07:17    阅读次数:128
最长公共子序列(南阳oj36)(最长公共子序列)
最长公共子序列 时间限制:3000 ms  |  内存限制:65535 KB 难度:3 描述咱们就不拐弯抹角了,如题,需要你做的就是写一个程序,得出最长公共子序列。 tip:最长公共子序列也称作最长公共子串(不要求连续),英文缩写为LCS(Longest Common Subsequence)。其定义是,一个序列 S ,如果分别是两个或多个已知序列的子序列,且是所有符合...
分类:其他好文   时间:2014-12-08 17:56:00    阅读次数:183
-----[DP] LCS小结
额、、失误、、LCS是Longest Common Subsequence的缩写,即最长公共子序列。一个序列,如果是两个或多个已知序列的子序列,且是所有子序列中最长的,则为最长公共子序列。DP、O(n^2)解法:#include #include #include using namespace s...
分类:其他好文   时间:2014-12-08 13:51:44    阅读次数:161
leetcode Longest Consecutive Sequence
给定一个数组,找出里面连续的子序列的最长长度。例如:Given[100, 4, 200, 1, 3, 2],The longest consecutive elements sequence is[1, 2, 3, 4]. Return its length:4.思路一:排序,然后count一下就o...
分类:其他好文   时间:2014-12-06 20:15:40    阅读次数:166
Longest Substring Without Repeating Characters
题目描述:Given a string, find the length of the longest substring without repeating characters. For example, the longest substring without repeating lette...
分类:其他好文   时间:2014-12-05 21:10:24    阅读次数:187
Leetcode: Maximum Depth of Binary Tree
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-12-05 21:07:13    阅读次数:167
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!