/QuickSort

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.

Primary LanguageC++

QuickSort

Write a program to sort an array of 100,000 random elements using quicksort as follows:

  1. Sort the arrays using pivot as the middle element of the array
  2. Sort the arrays using pivot as the median of the first, last, and middle elements of the array
  3. 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.
  4. 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.
  5. Calculate and display the CPU time for each of the preceding four steps.