Originally Posted by
tabstop
Have you never done a program with randomness in it? Never done srand(time(0))?
Oh, i didnt notice, actually i used in the program i was talking about, sort random numbers
Code:
srand( time( NULL ) ); /* seed the rand function */
for ( i = 0; i < SIZE; i++ )
copy3[i]=_2ndcopy[i]=_1stcopy[i]=array[i] = rand() % 90 + 10; /* give each element a value */
But for time, calculating time, i really dnt understand how'd id set it to this code
Code:
clock_t start = clock();
bubbleSort(array, SIZE ); //calls bubblesort to sort 1st copy
printf("Time elapsed: %f seconds \n", ((double)clock() - start) / CLOCKS_PER_SEC);