mirror of
https://github.com/TheAlgorithms/Java.git
synced 2025-07-24 04:54:21 +08:00
Code cleanup (#4246)
This commit is contained in:
@ -44,5 +44,6 @@ public class BoyerMoore {
|
||||
a[i] = input.nextInt();
|
||||
}
|
||||
System.out.println("the majority element is " + findmajor(a));
|
||||
input.close();
|
||||
}
|
||||
}
|
||||
|
@ -1,7 +1,5 @@
|
||||
package com.thealgorithms.others;
|
||||
|
||||
import java.util.Scanner;
|
||||
|
||||
/**
|
||||
* @author Marcus
|
||||
*/
|
||||
|
@ -19,6 +19,7 @@ public class HappyNumbersSeq {
|
||||
}
|
||||
String res = n == 1 ? "1 Happy number" : "Sad number";
|
||||
System.out.println(res);
|
||||
in.close();
|
||||
}
|
||||
|
||||
private static int sumSquares(int n) {
|
||||
|
@ -118,5 +118,6 @@ public class Huffman {
|
||||
|
||||
// print the codes by traversing the tree
|
||||
printCode(root, "");
|
||||
s.close();
|
||||
}
|
||||
}
|
||||
|
@ -22,8 +22,7 @@ class Rotate_by_90_degree {
|
||||
}
|
||||
}
|
||||
|
||||
Rotate g = new Rotate();
|
||||
g.rotate(arr);
|
||||
Rotate.rotate(arr);
|
||||
printMatrix(arr);
|
||||
}
|
||||
sc.close();
|
||||
|
@ -1,8 +1,5 @@
|
||||
package com.thealgorithms.others.cn;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
final public class HammingDistance {
|
||||
private HammingDistance() {
|
||||
}
|
||||
|
Reference in New Issue
Block a user