arr = copyArr("rev"); startTime = clock(); selectionSort(arr); timePassed = clock() - startTime; for (int i = 0; i < size; i++) { cout << arr[i]<<", "; } cout << endl; delete [] arr; cout << "Selection: rev "<<timePassed << endl; arr = copyArr("ord"); startTime = clock(); selectionSort(arr); timePassed = clock() - startTime; for (int i = 0; i < size; i++) { cout << arr[i]<<", "; } cout << endl; delete [] arr; cout << "Selection: ord "<<timePassed << endl; //INSERTION arr = copyArr("rand"); startTime = clock(); insertionSort(arr); timePassed = clock() - startTime; for (int i = 0; i < size; i++) { cout << arr[i]<<", "; } cout << endl; [] arr; delete cout << "Insertion: rand "<<timePassed << endl; arr = copyArr("rev"); startTime = clock(); insertionSort(arr); timePassed = clock() - startTime; for (int i = 0; i < size; i++) { cout << arr[i]<<", "; } cout << endl; delete [] arr; cout << "Insertion: rev "<<timePassed << endl; arr = copyArr("ord"); startTime = clock(); insertionSort(arr); timePassed = clock() - startTime; for (int i = 0; i < size; i++) { cout << arr[i]<<", "; } cout << endl; delete [] arr;
arr = copyArr("rev"); startTime = clock(); selectionSort(arr); timePassed = clock() - startTime; for (int i = 0; i < size; i++) { cout << arr[i]<<", "; } cout << endl; delete [] arr; cout << "Selection: rev "<<timePassed << endl; arr = copyArr("ord"); startTime = clock(); selectionSort(arr); timePassed = clock() - startTime; for (int i = 0; i < size; i++) { cout << arr[i]<<", "; } cout << endl; delete [] arr; cout << "Selection: ord "<<timePassed << endl; //INSERTION arr = copyArr("rand"); startTime = clock(); insertionSort(arr); timePassed = clock() - startTime; for (int i = 0; i < size; i++) { cout << arr[i]<<", "; } cout << endl; delete [] arr; cout << "Insertion: rand "<<timePassed << endl; arr = copyArr("rev"); startTime = clock(); insertionSort(arr); timePassed = clock() - startTime; for (int i = 0; i < size; i++) { cout << arr[i]<<", "; } cout << endl; delete [] arr; cout << "Insertion: rev "<<timePassed << endl; arr = copyArr("ord"); startTime = clock(); insertionSort(arr); timePassed = clock() - startTime; for (int i = 0; i < size; i++) { cout << arr[i]<<", "; } cout << endl; delete [] arr;