码迷,mamicode.com
首页 >  
搜索关键字:longest consecutive    ( 3017个结果)
[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...
分类:其他好文   时间:2015-08-19 13:14:00    阅读次数:134
最长无重复字符子串
1 题目 Given a string,find the length of the longest substring without repeating characters. Forexample, the longest substring without repeating letters for"abcabcbb" is "abc", which the length is 3. F...
分类:其他好文   时间:2015-08-19 11:14:04    阅读次数:167
UVA 10100- Longest Match(dp之最长公共子序列)
题目地址:UVA 10100 题意:求两组字符串中最大的按顺序出现的相同单词数目。 思路:将字串中的连续的字母认作一个单词,依次计算出两个字符串中的单词,其中第1个字符串的单词序列为t1.word[1]…..t1.word[n],第2个字符串的单词序列为t2.word[1]…..t2.word[m]。然后将每个单词当成一个字符,使用LCS算法计算出两个字符串的最长公共子序列,该序列的长度就是最长...
分类:其他好文   时间:2015-08-18 21:30:39    阅读次数:118
[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...
分类:其他好文   时间:2015-08-18 18:02:56    阅读次数:198
PAT 1096. Consecutive Factors (20)
1096. Consecutive Factors (20)Among all the factors of a positive integer N, there may exist several consecutive numbers. For example, 630 can be fact...
分类:其他好文   时间:2015-08-18 14:01:37    阅读次数:134
最大回文字符串算法详解与优化
背景 最近开始研究算法,于是在leetcode上做算法题,第五题Longest Palindromic Substring便是关于回文子串的。 什么是回文字串 回文字符串是指将该字符串前后颠倒之后和该字符串一样的字符串。例如:a,aaaa,aba,abba… 最长回文子串 要求最长回文子串,就需要遍历每一个子串,时间复杂度是O(N²);判断字串是不是回文,时间复杂度是...
分类:编程语言   时间:2015-08-18 10:18:51    阅读次数:172
求最长公共子序列
最长公共子序列,英文缩写为LCS(Longest Common Subsequence)。其定义是,一个序列 S ,如果分别是两个或多个已知序列的子序列,且是所有符合此条件序列中最长的,则 S 称为已知序列的最长公共子序列。而最长公共子串(要求连续)和最长公共子序列是不同的。 #include "stdafx.h" #include #include using names...
分类:其他好文   时间:2015-08-17 19:34:36    阅读次数:116
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...
分类:其他好文   时间:2015-08-17 11:37:33    阅读次数:123
3.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 for "abcabcbb" is "abc", which the length is 3...
分类:其他好文   时间:2015-08-17 06:33:30    阅读次数:232
hdu 4055 Number String(dp)
Problem DescriptionThe signature of a permutation is a string that is computed as follows: for each pair of consecutive elements of the permutation, w...
分类:其他好文   时间:2015-08-17 06:29:05    阅读次数:145
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!