Skip to content
Branch: master
Find file History
Type Name Latest commit message Commit time
Failed to load latest commit information.
__test__ Add more test cases for finding max sub-array algorithm. Sep 4, 2018 Update READMEs. Jun 8, 2018
bfMaximumSubarray.js Add maximum subarray. May 1, 2018
dpMaximumSubarray.js Minor refactoring of dpMaximumSubarray. Sep 4, 2018

Maximum subarray problem

The maximum subarray problem is the task of finding the contiguous subarray within a one-dimensional array, a[1...n], of numbers which has the largest sum, where,

Maximum subarray

Maximum subarray


The list usually contains both positive and negative numbers along with 0. For example, for the array of values βˆ’2, 1, βˆ’3, 4, βˆ’1, 2, 1, βˆ’5, 4 the contiguous subarray with the largest sum is 4, βˆ’1, 2, 1, with sum 6.


You can’t perform that action at this time.