mirror of
https://github.com/TheAlgorithms/Java.git
synced 2025-07-07 09:45:04 +08:00
Update KadaneAlgorithm.java
This commit is contained in:
@ -14,10 +14,10 @@ public class KadaneAlgorithm {
|
|||||||
/**
|
/**
|
||||||
* This method implements Kadane's Algorithm
|
* 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
|
* @return The maximum contiguous subarray sum of the array
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
static int largestContiguousSum(int arr[]){
|
static int largestContiguousSum(int arr[]){
|
||||||
int i,len=arr.length,cursum=0,maxsum=Integer.MIN_VALUE;
|
int i,len=arr.length,cursum=0,maxsum=Integer.MIN_VALUE;
|
||||||
if(len==0) //empty array
|
if(len==0) //empty array
|
||||||
|
Reference in New Issue
Block a user