@Nikzy7 I add the code of Kadane Algorithm in C++ language
Please check and merge it.
Kadane's Algorithm is used to find out the maximum subarray sum from an array of integers.
Algorithm:
Begin
Function kadanes(int array[], int length):
Initialize
highestMax = 0
currentElementMax = 0
for i = 0 to length-1
currentElementMax = max(array[i],currentElementMax + array[i])
highestMax = max(highestMax, currentElementMax)
return highestMax
End
@Nikzy7 I add the code of Kadane Algorithm in C++ language Please check and merge it.
Kadane's Algorithm is used to find out the maximum subarray sum from an array of integers.
Algorithm:
Begin Function kadanes(int array[], int length): Initialize highestMax = 0 currentElementMax = 0 for i = 0 to length-1 currentElementMax = max(array[i],currentElementMax + array[i]) highestMax = max(highestMax, currentElementMax) return highestMax End