码迷,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-07-22 23:16:14    阅读次数:408
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-07-22 23:11:32    阅读次数:388
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-07-22 23:07:13    阅读次数:379
序列最的问题之最长公共子序列LCS
在程序设计竞赛中,我们时常会遇到序列求最值的问题。在讲今天的问题之前,先小小的说明一下,子序列与子串的问题。 子序列:在原序列中不一定连续; 子串:在原序列中必须连续。 接下来,就开始今天要讲的最长公共子序列LCS(Longest Common Subsequence).对于LCS这一类的...
分类:其他好文   时间:2014-05-01 01:38:24    阅读次数:287
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
2697条   上一页 1 ... 268 269 270
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!