From 2931648834290277343
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f78e5,50d5de99f39e8675,start
X-Google-Attributes: gidf78e5,public
X-Google-ArrivalTime: 1992-11-15 18:36:46 PST
Newsgroups: comp.std.c++
Path: sparky!uunet!zaphod.mps.ohio-state.edu!sol.ctr.columbia.edu!destroyer!cs.ubc.ca!newsserver.sfu.ca!mtichy
From: mtichy@fraser.sfu.ca (Martin Tichy)
Subject: Shell Sort
Message-ID: <1992Nov16.071937.12110@sfu.ca>
Sender: news@sfu.ca
Organization: Simon Fraser University, Burnaby, B.C., Canada
Date: Mon, 16 Nov 1992 07:19:37 GMT
Lines: 15

Can anyone please post or mail me a C++ shell sort?  I can't
seem to get this one to work.

void shell_sort (int list[], int size)
{
int i, j, gap;
 
for ( gap = size / 2; gap > 0; gap /= 2)
  for (i = gap; i < size; i++)
    for (j = i - gap; j >= 0; j -= gap)
      if (list [i] <= list [i+1]
        break;
swap ( &list [j], &list [j+1] );
}



