Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
GouthamGuna committed May 25, 2024
2 parents c275911 + 1607421 commit d2c59a1
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion checkstyle.xml
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@
<!-- Checks for Naming Conventions. -->
<!-- See https://checkstyle.org/checks/naming/index.html -->
<module name="ConstantName"/>
<!-- TODO <module name="LocalFinalVariableName"/> -->
<module name="LocalFinalVariableName"/>
<!-- TODO <module name="LocalVariableName"/> -->
<!-- TODO <module name="MemberName"/> -->
<!-- TODO <module name="MethodName"/> -->
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/com/thealgorithms/maths/DudeneyNumber.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ public static boolean isDudeney(final int n) {
throw new IllegalArgumentException("Input must me positive.");
}
// Calculating Cube Root
final int cube_root = (int) Math.round(Math.pow(n, 1.0 / 3.0));
final int cubeRoot = (int) Math.round(Math.pow(n, 1.0 / 3.0));
// If the number is not a perfect cube the method returns false.
if (cube_root * cube_root * cube_root != n) {
if (cubeRoot * cubeRoot * cubeRoot != n) {
return false;
}

// If the cube root of the number is not equal to the sum of its digits, we return false.
return cube_root == SumOfDigits.sumOfDigits(n);
return cubeRoot == SumOfDigits.sumOfDigits(n);
}
}
6 changes: 3 additions & 3 deletions src/main/java/com/thealgorithms/sorts/SimpleSort.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ public class SimpleSort implements SortAlgorithm {

@Override
public <T extends Comparable<T>> T[] sort(T[] array) {
final int LENGTH = array.length;
final int length = array.length;

for (int i = 0; i < LENGTH; i++) {
for (int j = i + 1; j < LENGTH; j++) {
for (int i = 0; i < length; i++) {
for (int j = i + 1; j < length; j++) {
if (SortUtils.less(array[j], array[i])) {
T element = array[j];
array[j] = array[i];
Expand Down

0 comments on commit d2c59a1

Please sign in to comment.