|
-
May 11th, 2012, 04:14 AM
#1
Qucik Sort Uisng last element as Pivot
hello
can anyone explain quick sort example using last element as pivot element. I know how to sort element using first and middle element as pivot element.
-
May 11th, 2012, 07:47 PM
#2
Re: Qucik Sort Uisng last element as Pivot
Best Regards,
BioPhysEngr
http://blog.biophysengr.net
--
All advice is offered in good faith only. You are ultimately responsible for effects of your programs and the integrity of the machines they run on.
-
May 12th, 2012, 02:58 AM
#3
Re: Qucik Sort Uisng last element as Pivot
i know that process but when first partition is done means elements which is less than pivot is in left side and elements which is greater than pivot is in right side of pivot.
but what is the other process when this is done. when i take example and trace this step i m confused..SO can you explain with example?
-
May 14th, 2012, 09:34 PM
#4
Re: Qucik Sort Uisng last element as Pivot
Well, if you think about it: if you know how to do the partition with the first or the middle element as the pivot, then to do the partition with the last element as the pivot, just swap it with the first or middle element then do what you already know.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|