Skip to content

style: enable LocalVariableName in CheckStyle #5191

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
May 28, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Resolved Method Name Bug
  • Loading branch information
cpu-pixel committed May 28, 2024
commit d1b4c1ed5f87435e2e94f8ca38c31b27afad2e5b
6 changes: 3 additions & 3 deletions src/main/java/com/thealgorithms/ciphers/DES.java
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ private String[] getSubkeys(String originalKey) {
return subKeys;
}

private String XOR(String a, String b) {
private String xOR(String a, String b) {
int i;
int l = a.length();
StringBuilder xor = new StringBuilder();
Expand Down Expand Up @@ -143,7 +143,7 @@ private String feistel(String messageBlock, String key) {
for (i = 0; i < 48; i++) {
expandedKey.append(messageBlock.charAt(EXPANSION[i] - 1));
}
String mixedKey = XOR(expandedKey.toString(), key);
String mixedKey = xOR(expandedKey.toString(), key);
StringBuilder substitutedString = new StringBuilder();

// Let us now use the s-boxes to transform each 6 bit (length here) block to 4 bits
Expand Down Expand Up @@ -175,7 +175,7 @@ private String encryptBlock(String message, String[] keys) {
// Iterate 16 times
for (i = 0; i < 16; i++) {
String eN = f0; // Previous Right block
String fN = XOR(e0, feistel(f0, keys[i]));
String fN = xOR(e0, feistel(f0, keys[i]));
e0 = eN;
f0 = fN;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ private static int upperBound(int[] ar, int l, int r, int key) {
return r;
}

public static int LIS(int[] array) {
public static int lis(int[] array) {
int len = array.length;
if (len == 0) {
return 0;
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/thealgorithms/searches/KMPSearch.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

class KMPSearch {

int KMPSearch(String pat, String txt) {
int kmpSearch(String pat, String txt) {
int m = pat.length();
int n = txt.length();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class StrassenMatrixMultiplicationTest {
// and has to be a Square Matrix

@Test
public void StrassenMatrixMultiplicationTest2x2() {
public void strassenMatrixMultiplicationTest2x2() {
int[][] a = {{1, 2}, {3, 4}};
int[][] b = {{5, 6}, {7, 8}};
int[][] expResult = {{19, 22}, {43, 50}};
Expand All @@ -21,7 +21,7 @@ public void StrassenMatrixMultiplicationTest2x2() {
}

@Test
void StrassenMatrixMultiplicationTest4x4() {
void strassenMatrixMultiplicationTest4x4() {
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}};
Expand All @@ -30,7 +30,7 @@ void StrassenMatrixMultiplicationTest4x4() {
}

@Test
void StrassenMatrixMultiplicationTestNegetiveNumber4x4() {
void strassenMatrixMultiplicationTestNegetiveNumber4x4() {
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}};
Expand Down