Maximum subarray problem: Difference between revisions

Content deleted Content added
Added a link for this algo from programming pearls
Changed -INFINITY to 0 as starting value according to programming pearls .The algorithm always insures that sequence will always have a positive number so our maximum sum will always be greater than or equal to zero.
Line 9:
Kadane's Algorithm(array[1..n])
begin
(maxSum, maxStartIndex, maxEndIndex) := (-INFINITY0, 0, 0)
currentMaxSum := 0
currentStartIndex := 1