The time complexity of a quick soft algorithm which makes use of a median, found by an O(n) algorithm, as pivot element is:
Show answerHide answer
Correct answer: (B) O(n log n)
Explanation
If the median is used as pivot, every split is exactly balanced: T(n) = 2T(n/2) + O(n), which gives O(n log n) even in the worst case.