Hi,
How do I convert this code from an ascending insertion sort to a descending sort..Also, if some one could please explain the last 6-7lines of the code it would be very helpful! Thank you!
void inserSort(int *orgAry, int *sortAry, int *plast)
{
/* Local Declaration */
int *pOrg;
int *pWalk;
int located;
int temp;
/* Statements */
for (pOrg = orgAry + 1; pOrg <= plast; pOrg++)
{
located = FALSE;
temp = *pOrg;
for(pWalk = pOrg - 1; pWalk >= orgAry && !located
if(temp < *pWalk)
{
*(pWalk +1) = *pWalk;
pWalk--;
}/* if */
else
located = TRUE;
*(pWalk + 1) = temp;
}/* for pOrg */
sortAry = pOrg - 1;
return;
}/* inserSort */