Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int dosort(int N)
- {
- vector<double> data(N);
- for(unsigned int i=0; i<N; i++) {
- data[i] = rand()/(RAND_MAX+1.0);
- }
- sort(data.begin(), data.end());
- }
- int main(int argc, char *argv[])
- {
- int times[7] = {10, 100, 10000, 10000, 1000000, 10000000};
- for(int i=0;i<7;i++)
- {
- clock_t start = clock();
- dosort(times[i]);
- clock_t end = clock();
- cout << ((double)(end-start))/CLOCKS_PER_SEC
- << "\n";
- }
- cout << "Done\n";
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement