Suppose we have a O(n) time algorithm that finds median of an unsorted array. Now consider a QuickSort implementation where we first find median using the above algorithm, then use median as pivot. What will be the worst case time complexity of this modified QuickSort. Q-1. A o(n^2 Logn) Which one is faster for 1000 data set to be sorted? B o(n^2) C o(n Logn Logn) D O(nLogn)

icon
Related questions
Question
advanced physics
Suppose we have a O(n) time algorithm that finds median of an unsorted array. Now consider
a QuickSort implementation where we first find median using the above algorithm, then use
median as pivot. What will be the worst case time complexity of this modified QuickSort.
Q-1.
A o(n^2 Logn)
Which one is faster
for 1000 data set to
be sorted?
B o(n^2)
C o(n Logn Logn)
D O(nLogn)
Transcribed Image Text:Suppose we have a O(n) time algorithm that finds median of an unsorted array. Now consider a QuickSort implementation where we first find median using the above algorithm, then use median as pivot. What will be the worst case time complexity of this modified QuickSort. Q-1. A o(n^2 Logn) Which one is faster for 1000 data set to be sorted? B o(n^2) C o(n Logn Logn) D O(nLogn)
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 2 images

Blurred answer