File tree 3 files changed +7
-7
lines changed
src/main/java/com/thealgorithms
3 files changed +7
-7
lines changed Original file line number Diff line number Diff line change 109
109
<!-- Checks for Naming Conventions. -->
110
110
<!-- See https://checkstyle.org/checks/naming/index.html -->
111
111
<module name =" ConstantName" />
112
- <!-- TODO < module name="LocalFinalVariableName"/> -- >
112
+ <module name =" LocalFinalVariableName" />
113
113
<!-- TODO <module name="LocalVariableName"/> -->
114
114
<!-- TODO <module name="MemberName"/> -->
115
115
<!-- TODO <module name="MethodName"/> -->
Original file line number Diff line number Diff line change @@ -16,13 +16,13 @@ public static boolean isDudeney(final int n) {
16
16
throw new IllegalArgumentException ("Input must me positive." );
17
17
}
18
18
// Calculating Cube Root
19
- final int cube_root = (int ) Math .round (Math .pow (n , 1.0 / 3.0 ));
19
+ final int cubeRoot = (int ) Math .round (Math .pow (n , 1.0 / 3.0 ));
20
20
// If the number is not a perfect cube the method returns false.
21
- if (cube_root * cube_root * cube_root != n ) {
21
+ if (cubeRoot * cubeRoot * cubeRoot != n ) {
22
22
return false ;
23
23
}
24
24
25
25
// If the cube root of the number is not equal to the sum of its digits, we return false.
26
- return cube_root == SumOfDigits .sumOfDigits (n );
26
+ return cubeRoot == SumOfDigits .sumOfDigits (n );
27
27
}
28
28
}
Original file line number Diff line number Diff line change @@ -4,10 +4,10 @@ public class SimpleSort implements SortAlgorithm {
4
4
5
5
@ Override
6
6
public <T extends Comparable <T >> T [] sort (T [] array ) {
7
- final int LENGTH = array .length ;
7
+ final int length = array .length ;
8
8
9
- for (int i = 0 ; i < LENGTH ; i ++) {
10
- for (int j = i + 1 ; j < LENGTH ; j ++) {
9
+ for (int i = 0 ; i < length ; i ++) {
10
+ for (int j = i + 1 ; j < length ; j ++) {
11
11
if (SortUtils .less (array [j ], array [i ])) {
12
12
T element = array [j ];
13
13
array [j ] = array [i ];
You can’t perform that action at this time.
0 commit comments