码迷,mamicode.com
首页 >  
搜索关键字:longest    ( 2697个结果
leetcode Longest Substring Without Repeating Characters
代码: 1 #include 2 3 using namespace std; 4 5 int lengthOfLongestSubString(string s) 6 { 7 if (s.length() == 0) 8 return 0; 9 int max ...
分类:其他好文   时间:2015-03-04 18:52:52    阅读次数:104
四道简单DP
DP类题目找到子问题(状态),然后找到转移方程,就OK#dp#likes matrixchain#according to two point's distance to recurrenceclass Solution: # @return a string def longest...
分类:其他好文   时间:2015-03-04 18:51:45    阅读次数:122
【LeetCode从零单排】No104 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 * p...
分类:其他好文   时间:2015-03-04 17:08:21    阅读次数:118
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-03-04 09:44:51    阅读次数:122
MITx: 6.00.1x Alphabetical Substrings (python)
Assume s is a string of lower case characters. Write a program that prints the longest substring of s in which the letters occur in alphabetical order. For example, if s = 'azcbobobegghakl', then y...
分类:编程语言   时间:2015-03-03 22:17:49    阅读次数:805
Longest Palindromic Substring
最长回文子串动态规划的方法的参考Palindrome Partitioning (回文子串题)代码:class Solution {public: string longestPalindrome(string s) { int n=s.size(); int dp...
分类:其他好文   时间:2015-03-03 20:39:26    阅读次数:105
MITx: 6.00.1x Alphabetical Substrings (python)
Assume s is a string of lower case characters.Write a program that prints the longest substring of s in which the letters occur in alphabetical order....
分类:编程语言   时间:2015-03-03 18:11:29    阅读次数:376
[LeetCode] 014. Longest Common Prefix (Easy) (C++/Java/Python)
[LeetCode] 014. Longest Common Prefix (Easy) (C++/Java/Python)...
分类:编程语言   时间:2015-03-03 16:46:23    阅读次数:141
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-03-02 23:48:30    阅读次数:157
POJ 2533 Longest Ordered Subsequence (LIS)
Longest Ordered Subsequence Time Limit: 2000MS   Memory Limit: 65536K Total Submissions: 35930   Accepted: 15779 Description A numeric sequence of ai is ordered if a1...
分类:其他好文   时间:2015-03-02 21:01:07    阅读次数:189
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!