retagged by
1,162 views
0 votes
0 votes
The median of n elements can be found in  O(logn) time.which one of the following is correct about worst case time complexity of quick sort,if always median is selected as pivot element?

a)O(logn)

b)O(n)

c)O(nlogn)

d)O(nloglogn)
retagged by

1 Answer

0 votes
0 votes
Since the time complexity of finding the median is O ( log n), it indicate the elements are sorted and binary search for finding the median has been applied.

Since the worst case of time complexity for taking pivot element as median the time complexity will ne O ( n log n)

Related questions

0 votes
0 votes
2 answers
2
1 votes
1 votes
3 answers
3
Jithin Jayan asked Dec 7, 2016
2,318 views
Suppose that the partition algorithm of quick sort always produce a 9-to-1 proportional split. Then the Running time of algorithm over an unsorted array of n-elements is ...
1 votes
1 votes
1 answer
4
Sambhrant Maurya asked Aug 6, 2018
1,121 views
After applying few passes of quick sort on a given array, the following output was obtained:1,10,5,8,25,44,55,30,70Then how many pivot elements are there in the above ou...