Selection Sort
Selection Sort
h>
#include <stdlib.h>
#include <time.h>
int min_idx = i;
min_idx = j;
arr[min_idx] = arr[i];
arr[i] = temp;
printf("\n");
int main() {
FILE *fptr;
if (fptr == NULL) {
printf("Error opening file!\n");
return 1;
srand(time(0));
if (arr == NULL) {
exit(0);
arr[i] = rand();
double cpu_time_used;
start = clock();
selectionSort(arr, n);
end = clock();
free(arr);
}
fclose(fptr);
return 0;