Suppose we have an O(n) time algorithm that finds the median of an unsorted array. Now consider a QuickSort implementation where we first find the median using the above algorithm, then use the median as a pivot. What will be the worst-case time complexity of this modified QuickSort?
O(n^2 Logn)
O(n^2)
O(n Logn Logn)
O(nLogn)
This question is part of this quiz :
Top MCQs on Complexity Analysis of Algorithms with Answers,Top MCQs on Sorting Algorithms with Answers,Top MCQs on QuickSort Algorithm with Answers