sort(nitem, compar, swap)
int (*compar)(), (*swap)();
{ /* shell sort - copied from kernighan and plauger */
int igap, imax, iplusg, iex, i;
for (igap=nitem/2; igap >0; igap =/ 2)
{
imax = nitem-igap;
iex = 1;
while (iex)
{
iex = 0;
for(i=0; i<imax; i++)
{
iplusg = i+igap;
if (!((*compar)(i,iplusg)))
{
(*swap)(i,iplusg);
iex = 1;
}
}
}
}
}