码迷,mamicode.com
首页 >  
搜索关键字:longest ordered subs    ( 3212个结果
Maximum Depth of Binary Tree leetcode java
题目: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 farthes....
分类:编程语言   时间:2014-07-31 02:41:15    阅读次数:229
[LeetCode] Longest Consecutive Sequence(DP)
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-07-31 02:19:45    阅读次数:243
POJ 1631 Bridging signals & 2533 Longest Ordered Subsequence
两个都是最长上升子序列,所以就放一起了1631 因为长度为40000,所以要用O(nlogn)的算法,其实就是另用一个数组c来存储当前最长子序列每一位的最小值,然后二分查找当前值在其中的位置;如果当前点不能作为当前最长子序列的最大值,则更新找到值为两者间的较小值。2533 就是一个裸的最长上升子序列...
分类:其他好文   时间:2014-07-30 20:13:04    阅读次数:230
UVa Problem 10191 Longest Nap (最长打盹时间)
// Longest Nap (最长打盹时间) // PC/UVa IDs: 110404/10191, Popularity: B, Success rate: average Level: 1 // Verdict: Accepted // Submission Date: 2014-07-28 // UVa Run Time: 0.018s // // 版权所有(C)2014,邱秋。meta...
分类:其他好文   时间:2014-07-29 14:57:08    阅读次数:223
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-07-29 14:28:48    阅读次数:218
最长回文字串 (The longest palindrome substring)
这两天去学了一下,觉得下面那篇文章写的很好,有例子,比较容易懂,所以转一下。以下内容来自:hihoCoder:小Hi和小Ho是一对好朋友,出生在信息化社会的他们对编程产生了莫大的兴趣,他们约定好互相帮助,在编程的学习道路上一同前进。这一天,他们遇到了一连串的字符串,于是小Hi就向小Ho提出了那个经典...
分类:其他好文   时间:2014-07-29 12:41:26    阅读次数:292
Minimum Window Substring &&& Longest Substring Without Repeating Characters 快慢指针,都不会退,用hashmap或者其他结构保证
1 public class Solution { 2 public static int lengthOfLongestSubstring(String s) { 3 4 char[] arr = s.toCharArray(); 5 int pre = 0; 6 ...
分类:Windows程序   时间:2014-07-29 10:51:46    阅读次数:355
LeetCode "First Missing Positive"
Similar with "Longest Consecutive Sequence". Another usage to hashset.Take care of corner cases!class Solution {public: int firstMissingPositive(in...
分类:其他好文   时间:2014-07-28 15:16:43    阅读次数:206
Longest Substring Without Repeating Characters leetcode java
题目:Given a string, find the length of the longest substring without repeating characters. For example, the longest substring without repeating letter....
分类:编程语言   时间:2014-07-28 11:34:30    阅读次数:265
Longest Common Prefix leetcode java
题目:Write a function to find the longest common prefix string amongst an array of strings.题解:解题思路是,先对整个String数组预处理一下,求一个最小长度(最长前缀肯定不能大于最小长度)。然后以第0个字符串....
分类:编程语言   时间:2014-07-28 11:33:30    阅读次数:241
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!