/// ///Brady Bodily ///A00987897 /// #include #include #include #include void Count_sort(int a[], int n, int thread_count); void PrintArray(int a[], int n); int main(int argc, char* argv[]) { int n = std::stoi(argv[1]); int thread_count = std::stoi(argv[2]); srand(100); int *a = (int *)malloc(n*sizeof(int)); for(auto i =0;i(malloc(n * sizeof(int))); #pragma omp parallel for num_threads(thread_count) default(none) private(i,j,count) shared(a,n,temp) for (i = 0; i < n; i++) { count = 0; for (j = 0; j < n; j++) if (a[j] < a[i]) count++; else if (a[j] == a[i] && j < i) count++; temp[count] = a[i]; } memcpy(a, temp, n*sizeof(int)); free(temp); } /* Count_sort */ void PrintArray(int a[], int n){ for(auto i = 0;i