Design QuickSort variant with O(n log n) worst-case
Analyze the design quicksort variant with o(n log n) worst-case.
Examples
Input:"test_input_1"
Output:"output_1"
Input:"test_input_2"
Output:"output_2"
Hints
Consider how median-of-medians can be used to select a good pivot that guarantees balanced partitions.
Recall that median-of-medians has a worst-case linear time complexity for selection—how can this be integrated into quicksort to ensure O(n log n) worst-case?
After partitioning around the median-of-medians pivot, analyze the recurrence relation to prove the O(n log n) worst-case time complexity.
Design QuickSort variant with O(n log n) worst-case
Analyze the design quicksort variant with o(n log n) worst-case.