Hello I am doing project where I have different sorting algorithms (QuickSort, BubbleSort etc). I measure time of each of them and at the end I need to make some comparison which one is the fastest, and so on.
bool testyBubblesort(){
long int before = GetTickCount();
a.BubbleSort_int();
long int after = GetTickCount();
double dif = double((after - before));
result &= testEqual(zoradane.vypis_pola(), a.vypis_pola(),dif, "Test sort array-int");
comparison(dif);
vypisVysledkuTestu(result, "Testy triedenia BubbleSortom");
return result;
}
This is my function, it tests whether arrays are sorted and measures time. The important part is comparison(dif); This should be the function that compares all sorts. Note that i use this function in other sorts too.
void comparison(double time){
vector<int> all_times;
all_times.push_back(time);
}
So i was thinking make vector array and then sort it is good idea but I dont know how I always get some error. Can u help me ? Thanks