码迷,mamicode.com
首页 >  
搜索关键字:subarray    ( 846个结果
[LeetCode] Maximum Average Subarray I 子数组的最大平均值
Given an array consisting of n integers, find the contiguous subarray of given length k that has the maximum average value. And you need to output the ...
分类:编程语言   时间:2017-08-06 15:04:50    阅读次数:115
560. Subarray Sum Equals K
subarray sum 问题常用hashmap, 存count 值和坐标, 动归的感觉啊 要用 preSum.put(0, 1); 是得result 加的值可以来自map中的多个. 不能 if (sum == k) { result++; } 因为: Input:[0,0,0,0,0,0,0,0, ...
分类:其他好文   时间:2017-08-03 23:43:52    阅读次数:177
leetcode 209. Minimum Size Subarray Sum
Given an array of n positive integers and a positive integer s, find the minimal length of a contiguous subarray of which the sum ≥ s. If there isn't ...
分类:其他好文   时间:2017-08-03 20:12:33    阅读次数:135
581. Shortest Unsorted Continuous Subarray 最短未排序的连续子阵列
Given an integer array, you need to find one continuous subarray that if you only sort this subarray in ascending order, then the whole array will be ... ...
分类:编程语言   时间:2017-07-27 01:02:04    阅读次数:188
[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, ...
分类:其他好文   时间:2017-07-25 19:30:46    阅读次数:155
leetCode 53. 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, ...
分类:其他好文   时间:2017-07-22 19:41:18    阅读次数:159
Coursera Algorithms week3 归并排序 练习测验1: Merging with smaller auxiliary array
题目原文: Suppose that the subarray a[0] to a[n-1] is sorted and the subarray a[n] to a[2*n-1] is sorted. How can you merge the two subarrays so that a[0] ...
分类:编程语言   时间:2017-07-22 00:44:32    阅读次数:284
Maximum Average Subarray I
https://leetcode.com/problems/maximum-average-subarray-i/#/description 求指定长度为 k 的子数组的最大均值,基本思路是用长度为k 的滑动窗口扫一遍原数组,然后记录最大子数组的MaxSum,最后返回MaxSum/k 可以优化的部分 ...
分类:其他好文   时间:2017-07-20 15:22:14    阅读次数:160
53. 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, ...
分类:其他好文   时间:2017-07-20 10:15:31    阅读次数:135
LeetCode 53. 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, ...
分类:编程语言   时间:2017-07-19 10:41:05    阅读次数:241
846条   上一页 1 ... 34 35 36 37 38 ... 85 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!