2,261 views
2 2 votes
With quick sort The results after first partioning of the given array.

A = (2,8,7,1,3,5,6,4,9).

Analysis the time complexity of Quick sort in the best case.

3 Answers

Best answer
2 2 votes
After the first pass,I think we would get the same array because 9 is the pivot element and all the no.s before it are smaller than it.So there wouldn't be any change.
• selected by
Position:
Show:

Related questions

3 3 votes
1 answers 1 answer
3.2k
3.2k views
iarnav asked Jan 14, 2018
3,191 views
You have an array of n elements. Suppose you implement quick sort by always choosing the central element of the array as the pivot. Then the tightest lower bound for the...
3 3 votes
3 answers 3 answers
2.2k
2.2k views
Sourajit25 asked Sep 3, 2017
2,232 views
"Quick sort has good cache performance" , Can anyone explain this statement.How is cache related to quick sort.I searched for this over the internet but could not find a ...
3 3 votes
1 1 answer
2.0k
2.0k views
SHALINI PORWAL asked Aug 10, 2017
1,952 views
When array is already sorted in reverse order then what will be the recurrence relation for number of swaps on array of n elements using quick sort?
0 0 votes
1 1 answer
3.2k
3.2k views
Anusha Motamarri asked Nov 2, 2016
3,218 views
@arjun sirwhy is quick sort with median as pivot not in practice even though it can sort the worst case list in O(nlogn) time?median can be found in O(n) time and this di...