码迷,mamicode.com
首页 >  
搜索关键字:longest    ( 2697个结果
LeetCode -- Longest Valid Parentheses(Dynamic Programming)
题目地址:https://leetcode.com/problems/longest-valid-parentheses/Given a string containing just the characters ‘(’ and ‘)’, find the length of the longest valid (well-formed) parentheses substring. For “(...
分类:其他好文   时间:2015-03-14 16:55:18    阅读次数:188
SPOJ Problem 1437:Longest path in a tree
求树的最长链,BFS和DFS都可以,时间复杂度O(n)#include#includeint tot,vt[20005],nxt[20005],a[20005];bool vis[10005];int n,i,j,xx,yy,s,ma,r;void search(int x,int dep){ .....
分类:其他好文   时间:2015-03-14 10:58:28    阅读次数:207
[LeetCode] 032. Longest Valid Parentheses (Hard) (C++)
[LeetCode] 032. Longest Valid Parentheses (Hard) (C++)...
分类:编程语言   时间:2015-03-13 16:35:05    阅读次数:170
LeetCode_Longest Consecutive Sequence
LeetCode_Longest Consecutive Sequence...
分类:其他好文   时间:2015-03-13 07:09:33    阅读次数:172
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...
分类:其他好文   时间:2015-03-13 00:14:25    阅读次数:141
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 lon...
分类:其他好文   时间:2015-03-11 23:17:44    阅读次数:155
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...
分类:其他好文   时间:2015-03-11 21:29:40    阅读次数:112
Longest Consecutive Sequence
Longest Consecutive Sequence问题:Given an unsorted array of integers, find the length of the longest consecutive elements sequence.思路: HashSet进行存储我的代码:....
分类:其他好文   时间:2015-03-11 21:23:53    阅读次数:110
uva 10405 Longest Common Subsequence (最长公共子序列)
uva 10405 Longest Common SubsequenceSequence 1:Sequence 2:Given two sequences of characters, print the length of the longest common subsequence of both sequences. For example, the longest common subseq...
分类:其他好文   时间:2015-03-11 00:47:35    阅读次数:140
LeetCode(4) || Longest Palindromic Substring 与 Manacher 线性算法
LeetCode(4) || Longest Palindromic Substring 与 Manacher 线性算法题记本文是LeetCode题库的第五题,没想到做这些题的速度会这么慢,工作之余全部耗在这上面了,只怪自己基础差。本文主要介绍使用Manacher线性算法来求解字符串的最长回文子字符...
分类:编程语言   时间:2015-03-10 23:02:35    阅读次数:203
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!