码迷,mamicode.com
首页 >  
搜索关键字:longest ordered subs    ( 3212个结果
最长回文子串(Longest Palindromic Substring)-DP问题
问题描述: 给定一个字符串S,找出它的最大的回文子串,你可以假设字符串的最大长度是1000,而且存在唯一的最长回文子串 。 思路分析: 动态规划的思路:dp[i][j] 表示的是 从i 到 j 的字串,是否是回文串。 则根据回文的规则我们可以知道: 如果s[i] == s[j] 那么是否是回文决定于 ...
分类:其他好文   时间:2016-09-14 20:41:45    阅读次数:131
POJ 2533 Longest Ordered Subsequence
题目链接: http://poj.org/problem?id=2533 Description A numeric sequence of ai is ordered if a1 < a2 < ... < aN. Let the subsequence of the given numeric s ...
分类:其他好文   时间:2016-09-13 22:21:59    阅读次数:177
leetcode 104
104. 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 th ...
分类:其他好文   时间:2016-09-13 13:29:52    阅读次数:150
LeetCode-Binary Tree Right Side View
Given a binary tree, imagine yourself standing on the right side of it, return the values of the nodes you can see ordered from top to bottom. For exa ...
分类:其他好文   时间:2016-09-13 07:53:07    阅读次数:136
leetcode:1-5题代码整理
以下是这段时间抽时间刷的前5题,都是自己想的解法,或许不是最优解,只是整理下,方便日后优化提升 1. Two Sum: 2. Add Two Numbers: 3. Longest Substring Without Repeating Characters: 4. Median of Two So ...
分类:其他好文   时间:2016-09-12 23:49:33    阅读次数:224
14. Longest Common Prefix
Write a function to find the longest common prefix string amongst an array of strings. Solution1: 思路:没有想到什么巧妙方法。就用recursion暴力硬做。发现只要想法对,recursion怎么做都能 ...
分类:其他好文   时间:2016-09-12 07:21:25    阅读次数:125
104. 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 l ...
分类:其他好文   时间:2016-09-11 23:02:10    阅读次数:142
[LintCode] Longest Increasing Continuous Subsequence 最长连续递增子序列
Give an integer array,find the longest increasing continuous subsequence in this array. An increasing continuous subsequence: Can be from right to lef ...
分类:其他好文   时间:2016-09-09 22:09:12    阅读次数:116
LeetCode-Longest Substring with At Least K Repeating Characters
Find the length of the longest substring T of a given string (consists of lowercase letters only) such that every character in T appears no less than ...
分类:其他好文   时间:2016-09-09 15:10:28    阅读次数:101
3. Longest Substring Without Repeating Characters
...
分类:其他好文   时间:2016-09-09 15:09:43    阅读次数:105
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!