Fixed Error:(6, 8) java: class algorithm is public, should be declared in a file named algorithm.java. Inside file PrimeFactorization, the name of public class was wrong.

This commit is contained in:
Maria Lungeanu
2020-05-25 00:21:28 +03:00
parent 63e5ce4c8f
commit a5f42e293b
25 changed files with 293 additions and 238 deletions

View File

@ -31,6 +31,15 @@ public final class ClosestPair {
* Minimum point length.
*/
private static double minNum = Double.MAX_VALUE;
public static void setMinNum(double minNum) {
ClosestPair.minNum = minNum;
}
public static void setSecondCount(int secondCount) {
ClosestPair.secondCount = secondCount;
}
/**
* secondCount
*/
@ -213,7 +222,7 @@ public final class ClosestPair {
for (int i = 0; i < totalNum; i++) {
double xGap = Math.abs(divideArray[divideX].x - divideArray[i].x);
if (xGap < minValue) {
secondCount++; // size of the array
ClosestPair.setSecondCount(secondCount + 1); // size of the array
} else {
if (divideArray[i].x > divideArray[divideX].x) {
break;
@ -250,7 +259,7 @@ public final class ClosestPair {
minValue = length;
// Conditional for registering final coordinate
if (length < minNum) {
minNum = length;
ClosestPair.setMinNum(length);
point1 = firstWindow[i];
point2 = firstWindow[j];
}
@ -260,7 +269,7 @@ public final class ClosestPair {
}
}
}
secondCount = 0;
ClosestPair.setSecondCount(0);
return minValue;
}
@ -288,7 +297,7 @@ public final class ClosestPair {
length = Math.sqrt(Math.pow(xGap, 2) + Math.pow(yGap, 2));
// Conditional statement for registering final coordinate
if (length < minNum) {
minNum = length;
ClosestPair.setMinNum(length);
}
point1 = arrayParam[0];
@ -311,7 +320,7 @@ public final class ClosestPair {
minValue = length;
if (length < minNum) {
// Registering final coordinate
minNum = length;
ClosestPair.setMinNum(length);
point1 = arrayParam[i];
point2 = arrayParam[j];
}