mirror of
https://github.com/TheAlgorithms/Java.git
synced 2025-07-06 17:29:31 +08:00
Update KadaneAlgorithm.java
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user