Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream.h>
- #include <vcl.h>
- #include <conio.h>
- #include <time.h>
- #include "File2.h"
- void main()
- {
- int *tab1, *tab2, ile;
- clock_t start, stop;
- double czas;
- cout << " Ile chcesz elementow: "; cin>> ile;
- tab1 = new int[ile];
- tab2 = new int[ile];
- for(int i=0; i<ile ; i++)
- {
- tab1[i] = rand()%100000+1;
- tab2[i] = tab1[i];
- }
- //--------------------------------------------------------------------------------------------- zaczyna sie liczenie czasu dla babelkowego
- start= clock();
- sortowanie_babelkowe(tab1,ile);
- stop= clock();
- czas = (double)(stop - start)/CLOCKS_PER_SEC;
- cout << " Czas sortowania babelkowego wynosi: " << czas << endl;
- //---------------------------------------------------------------------------------------------- konczy sie i zaczyna q sort
- start= clock();
- quicksort(tab2, 0,ile);
- stop= clock();
- czas = (double)(stop - start)/CLOCKS_PER_SEC;
- cout << " Czas sortowania babelkowego wynosi: " << czas << endl;
- // ----------------------------------------------------------------------------------------------
- delete [] tab1;
- delete [] tab2;
- getch();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement