码迷,mamicode.com
首页 >  
搜索关键字:subarray    ( 846个结果
【leetcode】Maximum Subarray
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-04-18 20:23:36    阅读次数:130
[leetcode]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 largest produ...
分类:其他好文   时间:2015-04-17 22:23:08    阅读次数:170
[LeetCode] Maximum Product Subarray
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 s...
分类:其他好文   时间:2015-04-13 16:44:36    阅读次数:129
Maximum Subarray
/*最大连续子序列*/class Solution {public: int maxSubArray(int A[], int n) { if(!n) return 0; int result = A[0],temp =0 ; for(int i = ...
分类:其他好文   时间:2015-04-11 16:05:23    阅读次数:116
Max subarray
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-04-11 13:10:37    阅读次数:84
LeetCode 53 Maximum Subarray**
题目:Maximum Subarray 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,?5,4], the contiguo...
分类:其他好文   时间:2015-04-09 17:25:35    阅读次数:171
Lintcode: Subarray Sum
Given an integer array, find a subarray where the sum of numbers is zero. Your code should return the index of the first number and the index of the l...
分类:其他好文   时间:2015-04-06 14:05:45    阅读次数:116
Leetcode #152 Maximum Product Subarray
题目链接:https://leetcode.com/problems/maximum-product-subarray/较麻烦的解法:先判断数组中有没有0,有的话可以转换为求"0之前"和"0之后"两部分的较大值。遍历,记录数组中负数的个数:偶数:由于数组中都是整数,最大值即这些值的乘积。奇数:有以下...
分类:其他好文   时间:2015-04-05 23:22:57    阅读次数:164
2.分治算法研究-搜索数组中的最大连续子集和 2014-3-11 11:37 阅读(16)
//分治算法研究var cc=consolefunction find_max_crossing_subarray(A,low,mid,high){ var max_left=mid,max_right=mid var left_sum=0 var sum=0 for(var i=mid;i>=lo...
分类:编程语言   时间:2015-04-03 14:57:30    阅读次数:130
letcode code]Maximum Subarray
1 题目: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...
分类:其他好文   时间:2015-04-02 22:06:17    阅读次数:166
846条   上一页 1 ... 65 66 67 68 69 ... 85 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!