Format code with prettier (#3375)

This commit is contained in:
acbin
2022-10-03 17:23:00 +08:00
committed by GitHub
parent 32b9b11ed5
commit e96f567bfc
464 changed files with 11483 additions and 6189 deletions

View File

@ -1,63 +1,57 @@
package com.thealgorithms.others;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.*;
import com.thealgorithms.dynamicprogramming.KadaneAlgorithm;
import org.junit.jupiter.api.Test;
public class KadaneAlogrithmTest {
@Test
void testForOneElement()
{
int a[]={-1};
assertTrue(KadaneAlgorithm.max_Sum(a,-1));
}
@Test
void testForTwoElements()
{
int a[]={-2,1};
assertTrue(KadaneAlgorithm.max_Sum(a,1));
}
@Test
void testForThreeElements()
{
int a[]={5,3,12};
assertTrue(KadaneAlgorithm.max_Sum(a,20));
}
@Test
void testForFourElements()
{
int a[]={-1,-3,-7,-4};
assertTrue(KadaneAlgorithm.max_Sum(a,-1));
}
@Test
void testForFiveElements()
{
int a[]={4,5,3,0,2};
assertTrue(KadaneAlgorithm.max_Sum(a,14));
}
@Test
void testForSixElements()
{
int a[]={-43,-45,47,12,87,-13};
assertTrue(KadaneAlgorithm.max_Sum(a,146));
}
@Test
void testForSevenElements()
{
int a[]={9,8,2,23,13,6,7};
assertTrue(KadaneAlgorithm.max_Sum(a,68));
void testForOneElement() {
int a[] = { -1 };
assertTrue(KadaneAlgorithm.max_Sum(a, -1));
}
@Test
void testForEightElements()
{
int a[]={9,-5,-5,-2,4,5,0,1};
assertTrue(KadaneAlgorithm.max_Sum(a,10));
}
}
@Test
void testForTwoElements() {
int a[] = { -2, 1 };
assertTrue(KadaneAlgorithm.max_Sum(a, 1));
}
@Test
void testForThreeElements() {
int a[] = { 5, 3, 12 };
assertTrue(KadaneAlgorithm.max_Sum(a, 20));
}
@Test
void testForFourElements() {
int a[] = { -1, -3, -7, -4 };
assertTrue(KadaneAlgorithm.max_Sum(a, -1));
}
@Test
void testForFiveElements() {
int a[] = { 4, 5, 3, 0, 2 };
assertTrue(KadaneAlgorithm.max_Sum(a, 14));
}
@Test
void testForSixElements() {
int a[] = { -43, -45, 47, 12, 87, -13 };
assertTrue(KadaneAlgorithm.max_Sum(a, 146));
}
@Test
void testForSevenElements() {
int a[] = { 9, 8, 2, 23, 13, 6, 7 };
assertTrue(KadaneAlgorithm.max_Sum(a, 68));
}
@Test
void testForEightElements() {
int a[] = { 9, -5, -5, -2, 4, 5, 0, 1 };
assertTrue(KadaneAlgorithm.max_Sum(a, 10));
}
}