in Algorithms
1,203 views
2 votes
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.
in Algorithms
1.2k views

1 comment

3 Answers

2 votes
2 votes
Best answer
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

2 Comments

respected mam i am also having confusion mam please post your entire solution please
0
0
Plz don't call me ma'am.And for this I referred to the algorithm of quick sort given in Cormen.You once see that and try this.Here pivot is always chosen as the last element so 9 will be the pivot and then all the elements before it are checked.If they are smaller then no change and all the elements here are smaller than 9.So there should not be any change in the array.According to me.
1
1
1 vote
1 vote

you can select 2 as pivot element

0 votes
0 votes
If we take 9 as the pivot element the array remains same bcoz no one is greater than 9

Related questions