Skip to content

Commit e660f67

Browse files
vil02siriak
andcommitted
style: fix typos and remove redundant main mehtod
Co-authored-by: Andrii Siriak <[email protected]>
1 parent b42e2ab commit e660f67

File tree

4 files changed

+11
-16
lines changed

4 files changed

+11
-16
lines changed

src/main/java/com/thealgorithms/datastructures/trees/nearestRightKey.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
import java.util.Scanner;
44
import java.util.concurrent.ThreadLocalRandom;
55

6-
final class Main {
7-
private Main() {
6+
final class NearestRightKey {
7+
private NearestRightKey() {
88
}
99

1010
public static void main(String[] args) {

src/main/java/com/thealgorithms/misc/Sparcity.java renamed to src/main/java/com/thealgorithms/misc/Sparsity.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,17 @@
1111
* @author Ojasva Jain
1212
*/
1313

14-
final class Sparcity {
15-
private Sparcity() {
14+
final class Sparsity {
15+
private Sparsity() {
1616
}
1717

1818
/*
19-
* @return Sparcity of matrix
19+
* @return Sparsity of matrix
2020
*
21-
* where sparcity = number of zeroes/total elements in matrix
21+
* where sparsity = number of zeroes/total elements in matrix
2222
*
2323
*/
24-
static double sparcity(double[][] mat) {
24+
static double sparsity(double[][] mat) {
2525
int zero = 0;
2626
// Traversing the matrix to count number of zeroes
2727
for (int i = 0; i < mat.length; i++) {
@@ -31,7 +31,7 @@ static double sparcity(double[][] mat) {
3131
}
3232
}
3333
}
34-
// return sparcity
34+
// return sparsity
3535
return ((double) zero / (mat.length * mat[1].length));
3636
}
3737

@@ -50,7 +50,7 @@ public static void main(String[] args) {
5050
mat[i][j] = in.nextDouble();
5151
}
5252
}
53-
System.out.println("Sparcity of matrix is: " + sparcity(mat));
53+
System.out.println("Sparsity of matrix is: " + sparsity(mat));
5454
in.close();
5555
}
5656
}

src/main/java/com/thealgorithms/others/PasswordGen.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,6 @@ final class PasswordGen {
1515
private PasswordGen() {
1616
}
1717

18-
public static void main(String[] args) {
19-
String password = generatePassword(8, 16);
20-
System.out.print("Password: " + password);
21-
}
22-
2318
static String generatePassword(int min_length, int max_length) {
2419
Random random = new Random();
2520

src/main/java/com/thealgorithms/others/RotateMatriceBy90Degree.java renamed to src/main/java/com/thealgorithms/others/RotateMatrixBy90Degrees.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
*/
77
import java.util.Scanner;
88

9-
class Rotate_by_90_degree {
10-
private Rotate_by_90_degree() {
9+
class Rotate_by_90_degrees {
10+
private Rotate_by_90_degrees() {
1111
}
1212

1313
public static void main(String[] args) {

0 commit comments

Comments
 (0)