Add Task 6 sorter, fix method signatures, generate solution PDF
This commit is contained in:
@@ -21,7 +21,7 @@ public class PrimeNumberGenerator {
|
||||
}
|
||||
return true;
|
||||
}
|
||||
private int countPrimes() {
|
||||
public int countPrimeNumbers() {
|
||||
int count = 0;
|
||||
for (int i = 2; i <= maximum; i++) {
|
||||
if (isPrime(i)) {
|
||||
@@ -37,7 +37,7 @@ public class PrimeNumberGenerator {
|
||||
System.out.println("maximum,Anzahl Primzahlen (Algorithmus),maximum/ln(maximum) (Schätzung)");
|
||||
for (int max : testValues) {
|
||||
PrimeNumberGenerator generator = new PrimeNumberGenerator(max);
|
||||
int counted = generator.countPrimes();
|
||||
int counted = generator.countPrimeNumbers();
|
||||
double estimated = max / Math.log(max);
|
||||
System.out.printf("%d,%d,%.1f%n", max, counted, estimated);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user