https://leetcode.com/problems/maximum-subarray/动态规划:用res数组来记录包含了每个点的连续数组的和的最大的情况解的情况,后续的每次计算参考前面的计算结果。 1 class Solution { 2 public: 3 int maxSubAr...
分类:
其他好文 时间:
2015-07-13 17:34:41
阅读次数:
89
Jeff Janes:Hi,As part of our monitoring work for our customers, we stumbled upon an issue with our customers' servers who have a wal_keep_segments set...
分类:
其他好文 时间:
2015-07-13 00:45:29
阅读次数:
201
Guillaume Lelarge:Hi,As part of our monitoring work for our customers, we stumbled upon an issue with our customers' servers who have a wal_keep_segme...
分类:
其他好文 时间:
2015-07-13 00:34:45
阅读次数:
201
题目:Say you have an array for which theithelement is the price of a given stock on dayi.Design an algorithm to find the maximum profit. You may complet...
分类:
其他好文 时间:
2015-07-12 22:56:05
阅读次数:
126
Find the contiguous subarray within an array (containing at least one number) which has the largest sum.For example, given the array[?2,1,?3,4,?1,2,1,...
分类:
其他好文 时间:
2015-07-12 22:53:56
阅读次数:
146
Jump Game II
Given an array of non-negative integers, you are initially positioned at the first index of the array.
Each element in the array represents your maximum jump length at that position...
分类:
其他好文 时间:
2015-07-12 14:21:04
阅读次数:
125
hdu 1231, maximum consecutive sum of integers, finding the boundaries, possibly all negative, C++...
分类:
编程语言 时间:
2015-07-12 09:38:28
阅读次数:
137
题目:Say you have an array for which theithelement is the price of a given stock on dayi.Design an algorithm to find the maximum profit. You may complet...
分类:
其他好文 时间:
2015-07-11 17:59:06
阅读次数:
134
题意:给一棵二叉树,求其深度。思路:递归比较简洁,先求左子树深度,再求右子树深度,比较其结果,返回:max_one+1。 1 /** 2 * Definition for a binary tree node. 3 * struct TreeNode { 4 * int val; 5 ...
分类:
其他好文 时间:
2015-07-11 13:25:41
阅读次数:
125
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 longes...
分类:
其他好文 时间:
2015-07-11 09:00:02
阅读次数:
101