I have an assignment about quick sort and insertion sort and i didnt understand it all :'( !!
sort an array of 10,000 elements using the quick sort algorithm as follows:
a- sort the array using pivot as the middle element of the array.
b- Sort the using pivot as the median of the fist,last and middle elements of the array .
c- sort the array using pivot as the middle element of the array.However ,what the size of any sub list reduces to less than 20 ,sort the sublist using an insertion sort .
d-Sort the using pivot as the median of the fist,last and middle elements of the array .When the size of any sublist reduces to less than 20 ,sort the sublist using an insertion sort.
e-Calculate the print the CPU time for each of the preceding four steps
It seems that you have just studied the sorting algorithms so their details should be fresh in your mind, but not in ours.
The assignment implies that the "quicksort" has concepts "pivot" and "sublist". I have no recollection what they mean, but your study material should have them.
The middle element of an array and the median of a three-element array are unrelated to sorting. Perhaps you have had average and mode too in the same class?
Timing a piece of code. There are functions that return current time. Have you used headers <chrono> or <ctime> ?