Skip to content
Snippets Groups Projects
Commit ec760ffa authored by 13513055's avatar 13513055
Browse files

Edit bucket sort

parent 4bceea48
No related merge requests found
No preview for this file type
......@@ -71,15 +71,22 @@ int main(int argc, char *argv[]) {
}
// Print element
printf("Array Awal : [");
/* printf("Array Awal : [");
for (i=0; i<n-1; i++) {
printf("%d, ", array[i]);
}
printf("%d]\n", array[i]);
printf("%d]\n", array[i]); */
// Timer (start)
double starttime = MPI_Wtime();
if (world_size == 1) {
insertionSort(array, n);
double endtime = MPI_Wtime();
printf("Waktu : %lf sekon\n", endtime-starttime);
return 0;
}
// Calculate max number in each bucket
for(i=0; i<n; i++) {
int position = array[i] / (n/num_bucket);
......@@ -116,10 +123,10 @@ int main(int argc, char *argv[]) {
// Timer (end)
double endtime = MPI_Wtime();
printf("Array Akhir: [");
/* printf("Array Akhir: [");
for(i=0; i<n-1; i++) {
printf("%d, ", array[i]);
}
} */
printf("%d]\n", array[i]);
printf("Waktu : %lf sekon\n", endtime-starttime);
......
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