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. Algorithms algorithms quick-sort time-complexity sorting + – LavTheRawkstar asked Apr 15, 2017 LavTheRawkstar 1.2k views answer comment Share Follow See 1 comment See all 1 1 comment reply lU$er commented Apr 15, 2017 reply Follow Share Possible duplicate of https://gateoverflow.in/125608/a-list-of-elements-are-given-a-3-1-4-1-5-9-2-6-5-3-5-8-9#a125613 0 votes 0 votes Please log in or register to add a comment.
Best answer 2 votes 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. Purvi Agrawal answered Apr 15, 2017 selected Apr 15, 2017 by LavTheRawkstar Purvi Agrawal comment Share Follow See all 2 Comments See all 2 2 Comments reply LavTheRawkstar commented Apr 15, 2017 reply Follow Share respected mam i am also having confusion mam please post your entire solution please 0 votes 0 votes Purvi Agrawal commented Apr 15, 2017 reply Follow Share 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 votes 1 votes Please log in or register to add a comment.
1 votes 1 votes you can select 2 as pivot element sandeepjkh answered Sep 6, 2017 sandeepjkh comment Share Follow See all 0 reply Please log in or register to add a comment.
0 votes 0 votes If we take 9 as the pivot element the array remains same bcoz no one is greater than 9 sandeepjkh answered Sep 6, 2017 sandeepjkh comment Share Follow See all 0 reply Please log in or register to add a comment.