Update KadaneAlgorithm.java

This commit is contained in:
Nishita Aggarwal 2017-12-08 02:36:20 +05:30 committed by GitHub
parent 62fdf0d44e
commit 9dc1ac2b7f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -14,10 +14,10 @@ public class KadaneAlgorithm {
/**
* This method implements Kadane's Algorithm
*
* @param arr The input array
* @param arr The input array
* @return The maximum contiguous subarray sum of the array
*
*/
*
*/
static int largestContiguousSum(int arr[]){
int i,len=arr.length,cursum=0,maxsum=Integer.MIN_VALUE;
if(len==0) //empty array