File tree Expand file tree Collapse file tree 3 files changed +7
-7
lines changed
src/main/java/com/thealgorithms Expand file tree Collapse file tree 3 files changed +7
-7
lines changed Original file line number Diff line number Diff line change 109109 <!-- Checks for Naming Conventions. -->
110110 <!-- See https://checkstyle.org/checks/naming/index.html -->
111111 <module name =" ConstantName" />
112- <!-- TODO < module name="LocalFinalVariableName"/> -- >
112+ <module name =" LocalFinalVariableName" />
113113 <!-- TODO <module name="LocalVariableName"/> -->
114114 <!-- TODO <module name="MemberName"/> -->
115115 <!-- 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) {
1616 throw new IllegalArgumentException ("Input must me positive." );
1717 }
1818 // 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 ));
2020 // 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 ) {
2222 return false ;
2323 }
2424
2525 // 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 );
2727 }
2828}
Original file line number Diff line number Diff line change @@ -4,10 +4,10 @@ public class SimpleSort implements SortAlgorithm {
44
55 @ Override
66 public <T extends Comparable <T >> T [] sort (T [] array ) {
7- final int LENGTH = array .length ;
7+ final int length = array .length ;
88
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 ++) {
1111 if (SortUtils .less (array [j ], array [i ])) {
1212 T element = array [j ];
1313 array [j ] = array [i ];
You can’t perform that action at this time.
0 commit comments