small improvement and same values while running the tests

This commit is contained in:
Sebastian Brosch 2024-05-16 10:47:47 +02:00
parent 0b552e9d0f
commit 8c527a98de

View File

@ -12,15 +12,15 @@ import java.util.Random;
public class Aufgabe03 {
public static void main(String[] args) {
final int MAX_RUNS = 10;
int[] sizes = { 10000, 20000, 50000, 100000, 200000, 500000, 1000000, 2000000, 5000000, 10000000, 20000000,
50000000 };
int[] sizes = new int[] { 10000, 20000, 50000, 100000, 200000, 500000, 1000000, 2000000, 5000000, 10000000,
20000000, 50000000 };
for (int size : sizes) {
long sumArrayList = 0;
long sumLinkedList = 0;
ArrayList<String> values = getValues(size);
for (int i = 0; i < MAX_RUNS; i++) {
ArrayList<String> values = getValues(size);
sumArrayList += runTestArrayList(values);
sumLinkedList += runTestLinkedList(values);
}