#include "bsp_1_e.h" #include #include // BSP 1_E using namespace std; int main() { int n = 1e4; // verwende nicht 1e6 und höher - braucht 100s und aufwärts (Vektor) // für 1e5 benötigt die Liste recht lang, einige Minuten // Vektoren vector x = gensortvec(n); vector y = genrandvec(n); auto time1start = chrono::system_clock::now(); vector s1 = sortvec(x,y); auto time1end = chrono::system_clock::now(); auto time1 = chrono::duration_cast(time1end - time1start); cout << "Vektor, n = " << n << endl; cout << "time needed: " << time1.count() << " ms" << endl << endl; // Listen list a = gensortlist(n); list b = genlistfromvec(y); auto time2start = chrono::system_clock::now(); list s2 = sortlist(a,b); auto time2end = chrono::system_clock::now(); auto time2 = chrono::duration_cast(time2end - time2start); cout << "Liste, n = " << n << endl; cout << "time needed: " << time2.count() << " ms" << endl << endl; return 0; }