!7 !include once #1024427 // LogNArray v4 p-exp { new LogNArray a; int n = 100000; int[] random = new int[n]; for i to n: random[i] = random(n); twice { time { a.clear(); for i to n: a.add(random[i]); }} printBenchResult("Adding", n); twice { time { for i to n: a.get(i); }} printBenchResult("Accessing in order", n); twice { time { for i to n: a.get(random[i]); }} printBenchResult("Accessing in random order", n); /*twice*/ { time { for i to n: { a.remove(mod(random[i], l(a))); } }} printBenchResult("Removing in random order (without warm-up)", n); }