Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void test(int ile, char znak, int p, bool r, int t)
- {
- clock_t start,stop;
- double czas;
- bool kom = true;
- int **tab = new int * [ile];
- for(int i=0; i<100; i++) { tab[i] = new int [ile]; generowanie_tabeli(tab[i],ile,p,r); }
- start = clock();
- for(int i=0; i<100; i++)
- {
- if(znak == 's') MergeSort(0,ile-1,tab[i],ile);
- if(znak == 'q') QuickSort(tab[i],0,ile-1);
- if(znak == 'i') IntroSort(tab[i],ile);
- try { sprawdzenie(tab[i],ile); }
- catch(bool w) { kom = w; }
- }
- stop = clock();
- czas = (double)(stop-start) / CLOCKS_PER_SEC;
- for(int i=0; i<100; i++) delete [] tab[i];
- delete [] tab;
- cout << "Czas: " << setprecision(10) << czas << " s" << endl;
- if(kom == true) cout << "sort sie udal" << endl;
- else cout << "sort sie nie udal" << endl;
- getchar();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement