Content deleted Content added
Tellarunbose (talk | contribs) |
Tellarunbose (talk | contribs) |
||
Line 4:
==Kadane's algorithm==
Kadane's algorithm consists of a scan through the array values, computing at each position the maximum subarray ending at that position. This subarray is either empty (in which case [[empty sum|its sum is zero]]) or consists of one more element than the maximum subarray ending at the previous position. Thus, the problem can be solved with the following algorithm
<pre>
|