0

Is it the median of 3 to solve the worst time complexity in Quick sort?

also,

Is there a worst-case time complexity when using the median of 3 method?

  • 2
    Using median of three to find a pivot does not change the worst case time complexity for quicksort, it just changes the input data that would result in this worst case scenario. – Matt Oct 20 '18 at 05:58
  • 1
    Possible duplicate of [median of three values strategy](https://stackoverflow.com/questions/7559608/median-of-three-values-strategy) – Matt Oct 20 '18 at 05:59

1 Answers1

0

I think the worst time complexity of quick sort by making median as pivot all the time is O(nlogn). you can find median in O(n) time.