On 8/13/06, Arunachalam <
[EMAIL PROTECTED]> wrote:
Can you please send the link of hoares partition?Only reason I could think of is, for the first case all the elements before are less than or equal to the pivot. All the elements afterwards will be greater than or equal to pivot.But for the second case, we can conclude that only all the elements afterwards are greater than or equal to the pivot.regardsArunachalam.
On 8/13/06, Alireza Ghasemi < [EMAIL PROTECTED]> wrote:Hello,
In quicksort,some partitioning algorithms separate the pivot element from the two partitions they form,so that the sort procedure looks like : (i,j : first nd last elements)
if (i>j) return;
int p=partition(i,j);
sort(i,p-1);
sort(p+1,j);
while the others (like hoare's partitionig) place the pivot value into one of two partitions and sorting looks like :
if (i>j) return;
int p=partition(i,j);
sort(i,p);
sort(p+1,j);I couldn't understand why there is a difference.Could anybody help?
Thanks.http"//ww.livejournal.com/users/arunachalam
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/algogeeks
-~----------~----~----~----~------~----~------~--~---
