码迷,mamicode.com
首页 >  
搜索关键字:longest    ( 2697个结果
[译]最长回文子串(Longest Palindromic Substring) Part II
问题:给定字符串S,求S中的最长回文子串。 本篇将讨论一个O(N)时间O(N)空间的算法,即著名的Manacher算法,并详细说明其时间复杂度为何是O(N)。
分类:其他好文   时间:2014-12-15 23:23:40    阅读次数:356
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 leaf node. /** * Definition for binary tree ...
分类:其他好文   时间:2014-12-15 21:52:22    阅读次数:124
Longest Common Prefix
Write a function to find the longest common prefix string amongst an array of strings. #include #include #include char *longestCommonPrefix(char *strs[],int n) { int i,j,k; char *res=(...
分类:其他好文   时间:2014-12-15 20:24:22    阅读次数:174
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...
分类:其他好文   时间:2014-12-15 00:00:53    阅读次数:329
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...
分类:其他好文   时间:2014-12-14 00:38:30    阅读次数:161
Leetcode-Longest Substring with At Most Two Distinct Characters.
Given a string, find the length of the longest substring T that contains at most 2 distinct characters.For example, Given s = “eceba”,T is "ece" which...
分类:其他好文   时间:2014-12-13 06:07:09    阅读次数:137
LeetCode 刷题之二:寻找二叉树的最大深度
题目为: 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 leaf node. 阶梯思路:对于这种题目最简单的方法就是递归操作了...
分类:其他好文   时间:2014-12-12 23:40:13    阅读次数:374
Longest Substring Without Repeating Characters -- leetcode
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. Fo...
分类:其他好文   时间:2014-12-12 11:49:07    阅读次数:132
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 longes...
分类:其他好文   时间:2014-12-12 06:43:52    阅读次数:120
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. Fo...
分类:其他好文   时间:2014-12-11 22:33:05    阅读次数:403
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!