/MSP_kadane_pseudocode Secret
Created
November 8, 2017 07:23
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
max_ending_here = arr[0] //stores the sum of MSP till position 'i' | |
max_so_far = arr[0] //stores the sum of MSP | |
for i = 1 to size_of_array | |
{ | |
max_ending_here = max(ar[i], max_ending_here + arr[i]) | |
max_so_far = max(max_so_far, max_ending_here) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment