Write a program to sort an array of 100,000 random elements using quicksort as follows:
- Sort the arrays using pivot as the middle element of the array
- Sort the arrays using pivot as the median of the first, last, and middle elements of the array
- Sort the arrays using pivot as the middle element of the array. However,, when the size of any sub-list reduces to less than 20, sort the sub-list using insertion sort.
- Sort the array using pivot as the median of the first, last and middle elements of the array. When the size of any sub-list reduces to less than 20, sort the sub-list using insertion sort.
- Calculate and display the CPU time for each of the preceding four steps.