码迷,mamicode.com
首页 >  
搜索关键字:longest    ( 2697个结果
[LeetCode]Longest Valid Parentheses
Longest Valid Parentheses 最长有效括号对...
分类:其他好文   时间:2014-06-05 01:16:14    阅读次数:215
leetcode -day24 Maximum Depth of Binary Tree & Binary Tree Zigzag Level Order Traversal
1、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. clas...
分类:其他好文   时间:2014-06-02 23:13:22    阅读次数:290
【leetcode】 Longest Substring Without Repeating Characters
题目: 给定一个字符串,返回该串没有重复字符的最长子串。 分析: 1)子串:子串要求是连续的。 2)无重复,出现重复就断了,必须从新的位置开始。而新的位置就是重复字符第一次出现位置的下一个位置。 3)整个串可能没有一处重复。 那么,为了找出当前访问的字符是否出现过,要怎么做呢?当然是hash,O(1)的时间,而且既然是字符, 定义个255的hash table 就可以了,has...
分类:其他好文   时间:2014-06-01 10:48:31    阅读次数:206
【leetcode】Longest Palindromic Substring
题目:给定个字符串,返回chuan...
分类:其他好文   时间:2014-05-31 21:13:29    阅读次数:325
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-05-30 23:46:09    阅读次数:453
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-05-30 16:20:32    阅读次数:229
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-05-30 15:03:42    阅读次数:237
HDU 2253 Longest Common Subsequence Again
其实这个题我还不会,学长给了一个代码交上去过了,据说用到了一种叫做位压缩的技术,先贴代码吧,以后看懂了再来写#include #include #define M 30005#define SIZE 128#define WORDMAX 3200#define BIT 32char s1[M], s...
分类:其他好文   时间:2014-05-29 18:07:53    阅读次数:549
leetcode -day21 Longest Substring Without Repeating Characters
?? 1、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-05-26 05:03:19    阅读次数:172
求两个字符串最长公共子串(动态规划)
code如下: //Longest common sequence, dynamic programming method void FindLCS(char *str1, char *str2) { if(str1 == NULL || str2 == NULL) return; int length1 = strlen(str1)+1; int length2 = strlen(...
分类:其他好文   时间:2014-05-26 04:56:50    阅读次数:215
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!