码迷,mamicode.com
首页 >  
搜索关键字:longest consecutive    ( 3017个结果)
Longest Common Prefix
Write a function to find the longest common prefix string amongst an array of strings. class Solution { public: string longestCommonPrefix(vector& str...
分类:其他好文   时间:2015-10-30 09:20:08    阅读次数:165
Longest Palindromic Substring
问题链接:https://leetcode.com/problems/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 ...
分类:其他好文   时间:2015-10-30 02:21:57    阅读次数:199
Longest Substring Without Repeating Characters
问题链接:https://leetcode.com/problems/longest-substring-without-repeating-characters/ Given a string, find the length of the longest substring without repeating characters. For example, the longe...
分类:其他好文   时间:2015-10-29 06:21:35    阅读次数:182
LeetCode "Binary Tree Longest Consecutive Sequence"
A simple application to binary tree traversal.class Solution { typedef pair Rec; // last val - length unsigned ret; void go(TreeNode *p, Rec ...
分类:其他好文   时间:2015-10-28 12:09:31    阅读次数:140
leetcode2
今天闲来无事又刷了几道。Longest Valid ParenthesesGiven a string containing just the characters'('and')', find the length of the longest valid (well-formed) parent...
分类:其他好文   时间:2015-10-27 22:05:04    阅读次数:173
动态规划之最长公共子序列(LCS)
最长公共子序列(LCS,Longest Common Subsequence)。其定义是,一个序列 S ,如果分别是两个或多个已知序列的子序列,且是所有符合此条件序列中最长的,则 S 称为已知序列的最长公共子序列。而最长公共子串(要求连续)和最长公共子序列是不同的。设X(m)={x(1), x(2)...
分类:其他好文   时间:2015-10-26 00:37:29    阅读次数:202
Maximum Depth of Binary Tree
package cn.edu.xidian.sselab;/*** Given a binary tree, find its maximum depth.* The maximum depth is the number of nodes along the longest path from t...
分类:其他好文   时间:2015-10-24 23:32:01    阅读次数:262
Longest Valid Parentheses
将所有合法的括号即一对()都消除,用桟保存其中不合法的括号即单个(或)在字符串中的下标。那么每两个不合法之间的下标之差减1就是中间的合法串长度,依次从后向前比较,选出最大的字符串。 1 class Solution { 2 public: 3 int longestValidParenthe...
分类:其他好文   时间:2015-10-23 10:16:43    阅读次数:135
[LeetCode]32. Longest Common Prefix最长公共前缀
Write a function to find the longest common prefix string amongst an array of strings.解法:从所有的string的头到尾的字母逐一比较即可。class Solution {public: string lon...
分类:其他好文   时间:2015-10-22 12:28:49    阅读次数:187
[LeetCode]33. 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-10-22 12:04:38    阅读次数:148
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!