码迷,mamicode.com
首页 >  
搜索关键字:longest palindromic    ( 2914个结果
[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-07-22 23:16:14    阅读次数:408
LeetCode3: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 letter...
分类:其他好文   时间:2014-04-30 21:15:32    阅读次数:511
six solutions to a single symmetrical problem
Problem description:given a string, find the longest palindrome string in itSolution:1.brute force O(n^3)just enumerate start and end of the substring...
分类:其他好文   时间:2014-04-29 17:22:46    阅读次数:308
LeetCode OJ - Longest Consecutive Sequence
这道题中要求时间复杂度为O(n),首先我们可以知道的是,如果先对数组排序再计算其最长连续序列的时间复杂度是O(nlogn),所以不能用排序的方法。我一开始想是不是应该用动态规划来解,发现其并不符合动态规划的特征。最后采用类似于LRU_Cache中出现的数据结构(集快速查询和顺序遍历两大优点于一身)来...
分类:其他好文   时间:2014-04-28 10:21:19    阅读次数:1003
2914条   上一页 1 ... 290 291 292
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!