CS1103-programming2 Unit 1 Assignment
CS1103-programming2 Unit 1 Assignment
CS1103-programming2 Unit 1 Assignment
*/
import java.util.Arrays;
import java.util.Scanner;
public class BenchmarkingSortingAlgorithms {
int n = arr.length;
int min_idx = i;
arr[min_idx] = arr[i];
arr[i] = temp;
}
}
for(int i=0;i<arr.length;i++) {
System.out.print(arr[i]+" ");
for(int i = 0;i<arr.length;i++) {
selectionSort(arr);
long runTime = System.currentTimeMillis() - startTime;
sortByInBuilt(arr);
----------------------
output
---------
50
0 1 1 2 14 16 16 17 17 18 23 23 24 25 28 28 29 29 31 32 37 37 38 38 39 40 41 42 56 58 60 62 63 67 71 72
74 76 77 77 79 79 81 86 89 94 94 95 96 96
-----------------------------------------------
1000
---------------------------------
10000
Runtime of the Selection sort is:0.084 Seconds
-----------------------------------