mirror of
https://github.com/TheAlgorithms/Java.git
synced 2025-07-28 23:15:17 +08:00
style: enable MemberName
in checkstyle (#5193)
* style: enable MemberName in checkstyle * style: simply uncomment `MemberName` --------- Co-authored-by: Piotr Idzik <65706193+vil02@users.noreply.github.com>
This commit is contained in:
@ -6,7 +6,7 @@ import org.junit.jupiter.api.Test;
|
||||
|
||||
class StrassenMatrixMultiplicationTest {
|
||||
|
||||
StrassenMatrixMultiplication SMM = new StrassenMatrixMultiplication();
|
||||
StrassenMatrixMultiplication smm = new StrassenMatrixMultiplication();
|
||||
|
||||
// Strassen Matrix Multiplication can only be allplied to matrices of size 2^n
|
||||
// and has to be a Square Matrix
|
||||
@ -16,7 +16,7 @@ class StrassenMatrixMultiplicationTest {
|
||||
int[][] a = {{1, 2}, {3, 4}};
|
||||
int[][] b = {{5, 6}, {7, 8}};
|
||||
int[][] expResult = {{19, 22}, {43, 50}};
|
||||
int[][] actResult = SMM.multiply(a, b);
|
||||
int[][] actResult = smm.multiply(a, b);
|
||||
assertArrayEquals(expResult, actResult);
|
||||
}
|
||||
|
||||
@ -25,7 +25,7 @@ class StrassenMatrixMultiplicationTest {
|
||||
int[][] a = {{1, 2, 5, 4}, {9, 3, 0, 6}, {4, 6, 3, 1}, {0, 2, 0, 6}};
|
||||
int[][] b = {{1, 0, 4, 1}, {1, 2, 0, 2}, {0, 3, 1, 3}, {1, 8, 1, 2}};
|
||||
int[][] expResult = {{7, 51, 13, 28}, {18, 54, 42, 27}, {11, 29, 20, 27}, {8, 52, 6, 16}};
|
||||
int[][] actResult = SMM.multiply(a, b);
|
||||
int[][] actResult = smm.multiply(a, b);
|
||||
assertArrayEquals(expResult, actResult);
|
||||
}
|
||||
|
||||
@ -35,7 +35,7 @@ class StrassenMatrixMultiplicationTest {
|
||||
int[][] a = {{1, 2, 3, 4}, {5, 6, 7, 8}, {9, 10, 11, 12}, {13, 14, 15, 16}};
|
||||
int[][] b = {{1, -2, -3, 4}, {4, -3, -2, 1}, {5, -6, -7, 8}, {8, -7, -6, -5}};
|
||||
int[][] expResult = {{56, -54, -52, 10}, {128, -126, -124, 42}, {200, -198, -196, 74}, {272, -270, -268, 106}};
|
||||
int[][] actResult = SMM.multiply(a, b);
|
||||
int[][] actResult = smm.multiply(a, b);
|
||||
assertArrayEquals(expResult, actResult);
|
||||
}
|
||||
}
|
||||
|
@ -6,14 +6,14 @@ import org.junit.jupiter.api.Test;
|
||||
|
||||
class BinaryInsertionSortTest {
|
||||
|
||||
BinaryInsertionSort BIS = new BinaryInsertionSort();
|
||||
BinaryInsertionSort bis = new BinaryInsertionSort();
|
||||
|
||||
@Test
|
||||
// valid test case
|
||||
public void binaryInsertionSortTestNonDuplicate() {
|
||||
int[] array = {1, 0, 2, 5, 3, 4, 9, 8, 10, 6, 7};
|
||||
int[] expResult = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
|
||||
int[] actResult = BIS.binaryInsertSort(array);
|
||||
int[] actResult = bis.binaryInsertSort(array);
|
||||
assertArrayEquals(expResult, actResult);
|
||||
}
|
||||
|
||||
@ -21,7 +21,7 @@ class BinaryInsertionSortTest {
|
||||
public void binaryInsertionSortTestDuplicate() {
|
||||
int[] array = {1, 1, 1, 5, 9, 8, 7, 2, 6};
|
||||
int[] expResult = {1, 1, 1, 2, 5, 6, 7, 8, 9};
|
||||
int[] actResult = BIS.binaryInsertSort(array);
|
||||
int[] actResult = bis.binaryInsertSort(array);
|
||||
assertArrayEquals(expResult, actResult);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user