File tree 4 files changed +11
-16
lines changed
src/main/java/com/thealgorithms 4 files changed +11
-16
lines changed Original file line number Diff line number Diff line change 3
3
import java .util .Scanner ;
4
4
import java .util .concurrent .ThreadLocalRandom ;
5
5
6
- final class Main {
7
- private Main () {
6
+ final class NearestRightKey {
7
+ private NearestRightKey () {
8
8
}
9
9
10
10
public static void main (String [] args ) {
Original file line number Diff line number Diff line change 11
11
* @author Ojasva Jain
12
12
*/
13
13
14
- final class Sparcity {
15
- private Sparcity () {
14
+ final class Sparsity {
15
+ private Sparsity () {
16
16
}
17
17
18
18
/*
19
- * @return Sparcity of matrix
19
+ * @return Sparsity of matrix
20
20
*
21
- * where sparcity = number of zeroes/total elements in matrix
21
+ * where sparsity = number of zeroes/total elements in matrix
22
22
*
23
23
*/
24
- static double sparcity (double [][] mat ) {
24
+ static double sparsity (double [][] mat ) {
25
25
int zero = 0 ;
26
26
// Traversing the matrix to count number of zeroes
27
27
for (int i = 0 ; i < mat .length ; i ++) {
@@ -31,7 +31,7 @@ static double sparcity(double[][] mat) {
31
31
}
32
32
}
33
33
}
34
- // return sparcity
34
+ // return sparsity
35
35
return ((double ) zero / (mat .length * mat [1 ].length ));
36
36
}
37
37
@@ -50,7 +50,7 @@ public static void main(String[] args) {
50
50
mat [i ][j ] = in .nextDouble ();
51
51
}
52
52
}
53
- System .out .println ("Sparcity of matrix is: " + sparcity (mat ));
53
+ System .out .println ("Sparsity of matrix is: " + sparsity (mat ));
54
54
in .close ();
55
55
}
56
56
}
Original file line number Diff line number Diff line change @@ -15,11 +15,6 @@ final class PasswordGen {
15
15
private PasswordGen () {
16
16
}
17
17
18
- public static void main (String [] args ) {
19
- String password = generatePassword (8 , 16 );
20
- System .out .print ("Password: " + password );
21
- }
22
-
23
18
static String generatePassword (int min_length , int max_length ) {
24
19
Random random = new Random ();
25
20
Original file line number Diff line number Diff line change 6
6
*/
7
7
import java .util .Scanner ;
8
8
9
- class Rotate_by_90_degree {
10
- private Rotate_by_90_degree () {
9
+ class Rotate_by_90_degrees {
10
+ private Rotate_by_90_degrees () {
11
11
}
12
12
13
13
public static void main (String [] args ) {
You can’t perform that action at this time.
0 commit comments