码迷,mamicode.com
首页 >  
搜索关键字:maximum repetition s    ( 4177个结果
Binary Tree Maximum Path Sum
Given a binary tree, find the maximum path sum. The path may start and end at any node in the tree. 求树的一点到另一点的最大路径,利用递归的方法,ans 在 左子树,右子树,root+左+右的最大中产生。 /** * Definition for binary tree * struct ...
分类:其他好文   时间:2015-01-27 22:01:36    阅读次数:112
leetcode_5_Longest Palindromic Substring
描述: Given a string S, find the longest palindromic substring in S. You may assume that the maximum length of S is 1000, and there exists one unique longest palindromic substring. 思路: 刚开始非常天...
分类:其他好文   时间:2015-01-27 20:21:30    阅读次数:205
LeetCode Longest Palindromic Substring 最长回文子串
Given a string S, find the longest palindromic substring in S. You may assume that the maximum length of S is 1000, and there exists one unique longest palindromic substring.(最长回文子串) 中心扩展法: pub...
分类:其他好文   时间:2015-01-27 18:31:08    阅读次数:151
uboot命令及添加命令
include/command.h:struct cmd_tbl_s { char *name; /* Command Name */ int maxargs; /* maximum number of arguments 最大参数个数*/ int repeatable; ...
分类:其他好文   时间:2015-01-27 17:40:48    阅读次数:217
leetcode-----------Longest Palindromic Substring
题目:Given a string S, find the longest palindromic substring in S. You may assume that the maximum length of S is 1000, and there exists one unique longest palindromic substring. 下面是英文,祝你好运 ...
分类:其他好文   时间:2015-01-27 16:35:09    阅读次数:363
POJ 2479 Maximum sum
Maximum sum Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 34502   Accepted: 10692 Description Given a set of n integers: A={a1, a2,..., an}, we define a fu...
分类:其他好文   时间:2015-01-27 16:33:31    阅读次数:117
Longest Palindromic Substring
Given a string S, find the longest palindromic substring in S. You may assume that the maximum length of S is 1000, and there exists one unique longest palindromic substring. #include #includ...
分类:其他好文   时间:2015-01-27 15:02:38    阅读次数:164
Leetcode#53 Maximum Subarray
原题地址方法I:动态规划另sum[i]表示从i开始的最大子串和,则有递推公式:sum[i] = max{A[i], A[i] + sum[i+1]}因为递推式只用到了后一项,所以在编码实现的时候可以进行状态压缩,用一个变量即可代码: 1 int maxSubArray(int A[], int n)...
分类:其他好文   时间:2015-01-27 14:46:55    阅读次数:237
Best Time to Buy and Sell Stock II
本文是在学习中的总结,欢迎转载但请注明出处:http://blog.csdn.net/pistolove/article/details/43155725 Say you have an array for which the ith element is the price of a given stock on day i. Design an algorithm to find the maximum profit. You may complete as many tr...
分类:其他好文   时间:2015-01-26 22:57:31    阅读次数:180
[leetcode] 152 Maximum Product Subarray
问题描述: Find the contiguous subarray within an array (containing at least one number) which has the largest product. For example, given the array [2,3,-2,4], the contiguous subarray [2,3] has the l...
分类:其他好文   时间:2015-01-26 19:18:05    阅读次数:145
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!