Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static void main (String[] args) {
- for (int i = 0; i<6; i++) {
- double mySortTime = 0;
- double defaultSortTime = 0;
- double[] vals = new double [(int) Math.pow(10, i)];
- fillVals(vals, 1, 1000000);
- double [] copy = copyArr(vals);
- long time = System.nanoTime();
- bubbleSort(vals);
- mySortTime = System.nanoTime()-time;
- time = 0;
- time = System.nanoTime();
- sortPar(copy);
- defaultSortTime = System.nanoTime()-time;
- mySortTime /= 1000000.00;
- defaultSortTime = defaultSortTime/1000000.00;
- System.out.println("numVals " + Math.pow(10, i) + "\t Parmeet: " + defaultSortTime + "\t mine: " + mySortTime );
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement