Merge branch 'BAEL-5534' of github.com:navuluri/tutorials into BAEL-5534

This commit is contained in:
Bhaskara Navuluri
2022-06-07 12:17:31 +05:30
370 changed files with 1469 additions and 183 deletions
@@ -14,7 +14,7 @@ public class KadaneAlgorithm {
int end = 0;
int maxSoFar = arr[0], maxEndingHere = arr[0];
for (int i = 0; i < size; i++) {
for (int i = 1; i < size; i++) {
if (arr[i] > maxEndingHere + arr[i]) {
start = i;
@@ -27,4 +27,16 @@ class KadaneAlgorithmUnitTest {
//then
assertEquals(-1, maxSum);
}
@Test
void givenArrayWithAllPosiitveNumbersWhenMaximumSubarrayThenReturnsExpectedResult() {
//given
int[] arr = new int[] {4, 1, 3, 2};
//when
KadaneAlgorithm algorithm = new KadaneAlgorithm();
int maxSum = algorithm.maxSubArraySum(arr);
//then
assertEquals(10, maxSum);
}
}
@@ -8,7 +8,7 @@
<parent>
<groupId>com.baeldung</groupId>
<artifactId>apache-cxf</artifactId>
<artifactId>apache-cxf-modules</artifactId>
<version>0.0.1-SNAPSHOT</version>
</parent>
@@ -8,7 +8,7 @@
<parent>
<groupId>com.baeldung</groupId>
<artifactId>apache-cxf</artifactId>
<artifactId>apache-cxf-modules</artifactId>
<version>0.0.1-SNAPSHOT</version>
</parent>
@@ -8,7 +8,7 @@
<parent>
<groupId>com.baeldung</groupId>
<artifactId>apache-cxf</artifactId>
<artifactId>apache-cxf-modules</artifactId>
<version>0.0.1-SNAPSHOT</version>
</parent>

Some files were not shown because too many files have changed in this diff Show More