Advertisement
omone

Untitled

Mar 13th, 2018
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. double pomiar(vector<int> Dane, int Lserii, void(*sort)(vector<int>& ))
  2. {
  3. clock_t suma=0, start, koniec;
  4.  
  5. for (int i = 0; i < Lserii; i++) {
  6. start = clock();
  7. sort(Dane[i]);
  8. koniec = clock();
  9. suma += (koniec - start);
  10. }
  11. return static_cast<double> (static_cast<double>(suma) / static_cast<double>(Lserii)) / CLOCKS_PER_SEC * 1000.0;
  12.  
  13. }
  14. // jak wywoac w mainie
  15. vector<vector<int>> v = LosujVector();
  16.  
  17. cout << pomiar(v, 1000, QuickSort)<<endl;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement