I am working on a Project that improves the Quick-sort algorithms worst case time complexity. I modified the algorithm by choosing the median pivot instead of the left most selection and introduced insertion sort after a certain number of iterations. The results are as follows:
For an input of unsorted data of length 5000 to 100000:
- The number of Comparison made in my modified Quick-sort are very less than the number of comparisons made in regular Quick-sort.
- Elapsed time for both is zero secs for all length if data.
For an input of already sorted data of length 5000 to 100000:
- The number of Comparison made in my modified Quick-sort are still very less than the number of comparisons made in regular Quick-sort.
- Elapsed time for my modified Quick-sort is very less than the elapsed time of the regular Quick-sort for all length of data.
How can I now prove that the time complexity O(n^2) for already sorted data has been improved? I have all the above data but dont know how to theoretically show it? No direct answers but hints will be fine.