码迷,mamicode.com
首页 >  
搜索关键字:maximum subsequence    ( 5146个结果
Some Classical Recursive Functions
Some Classical Recursive FunctionsSome Classical Recursive FunctionsTable of Contents1. Find the maximum element of an array recursively.2. Recursivel...
分类:其他好文   时间:2014-08-26 11:14:05    阅读次数:170
字符串的截取,判断字符串是否相等和字符串是否为空的方法总结Java,Android
一、可以用subSequence方法截取任意长度的字符 二、判断字符串是否相等 三、判断字符串是否为空的四种方法: 最近做项目Android时遇到了字符串的截取,判断字符串是否相等和字符串是否为空问题刚好用的上自己也知道些,所以整理了方便以后用,和供大家参考,有什么更好的方法或者其它方法我么可以一起交流,谢谢大家!...
分类:移动开发   时间:2014-08-26 09:56:15    阅读次数:308
URAL 1079 Maximum
天天有个好心情 1 import java.util.Scanner; 2 3 public class P1079 4 { 5 public static void main(String args[]) 6 { 7 int a[] = new int[10000...
分类:其他好文   时间:2014-08-26 02:52:35    阅读次数:203
LeetCode: Binary Tree Maximum Path Sum
LeetCode: Binary Tree Maximum Path SumGiven a binary tree, find the maximum path sum.The path may start and end at any node in the tree. For example:G...
分类:其他好文   时间:2014-08-25 22:34:54    阅读次数:184
【机器学习算法-python实现】最大似然估计(Maximum Likelihood)
1.背景           最大似然估计是概率论中常常涉及到的一种统计方法。大体的思想是,在知道概率密度f的前提下,我们进行一次采样,就可以根据f来计算这个采样实现的可能性。当然最大似然可以有很多变化,这里实现一种简单的,实际项目需要的时候可以再更改。       博主是参照wiki来学习的,地址请点击我           这里实现的是特别简单的例子如下(摘自wiki的最大似然)离散分布,离散...
分类:编程语言   时间:2014-08-25 11:53:54    阅读次数:1655
【Leet Code】Longest Palindromic Substring ——传说中的Manacher算法
Longest Palindromic Substring  Total Accepted: 17474 Total Submissions: 84472My Submissions Given a string S, find the longest palindromic substring in S. You may assume that the maximum l...
分类:其他好文   时间:2014-08-24 16:46:02    阅读次数:190
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-08-23 21:35:21    阅读次数:264
POJ 3693 Maximum repetition substring(后缀数组神题)
POJ 3693 Maximum repetition substring 题目链接 题意:给定一个字符串,求出其子串中,重复次数最多的串,如果有相同的,输出字典序最小的 思路:枚举长度l,把字符串按l分段,这样对于长度为l的字符串,肯定会包含一个分段位置,这样一来就可以在每个分段位置,往后做一次lcp,求出最大匹配长度,然后如果匹配长度有剩余,看剩余多少,就往前多少位置再做一次...
分类:其他好文   时间:2014-08-23 19:05:11    阅读次数:215
poj3061 Subsequence ,尺取法
A sequence of N positive integers (10 < N < 100 000), each of them less than or equal 10000, and a positive integer S (S < 100 000 000) are given. Write a program to find the minimal length of the sub...
分类:其他好文   时间:2014-08-23 11:22:40    阅读次数:198
Leetcode - Binary Tree Maximum Path Sum
解题的关键在于这条路径只能是先往上走,到达某个最高点,再往下走,换句话说,只能有一次转折的机会。所以递归这棵树,记录以某个子节点为转折点时的最大值。值得注意的是树节点的值有负值,所以如果某个子路径的和小于0,放弃它(设置和为0)。 class Solution { public: int maxPathSum(TreeNode *root) { int maxSum = -1 <...
分类:其他好文   时间:2014-08-23 10:01:00    阅读次数:167
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!