Fakultas Ilmu Komputer UI

Commit 64a55fec authored by saddamonpc's avatar saddamonpc

Add timer

parent 9ffc4e28
......@@ -15,13 +15,16 @@ public class Main {
public static void main(String[] args) {
// write your code here
RNG rand = new RNG();
int arr[] = rand.getRandomIntArray(1000, 1, 1000000);
int arr[] = rand.getRandomIntArray(1000000, 1, 1000000);
int size = arr.length;
List<Integer> out = bucketSort(arr, size);
System.out.println("Result: ");
System.out.println(out);
System.out.println("Sorting...");
long startTime = System.currentTimeMillis();
List<Integer> out = bucketSort(arr, size);
long endTime = System.currentTimeMillis();
System.out.println("Done.");
System.out.println("Execution time: " + (endTime - startTime) + "ms");
}
private static int hash(int i, int max, int numberOfBuckets) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment