do u specifically want merge sort?? then i need to refer. i will post it later if u want. here is the bubble sort function.
void bubble_sort(char *a[],int n)
{
int i,j;
char temp[20];
for(i=0;i<n;i++)
{
for(j=1;j<(n-i);j++)
{
if(strcmp(a[j-1],a[j])>0)
{
strcpy(temp,a);
strcpy(a,b);
strcpy(b,temp);
}
}
}
}
//use strcmpi() if u want a case insensitive search
//n is the number elements in the array
//strcpy is used to copy the string
__________________
Quitters Never Win & Winners Never Quit!
|