home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The C Users' Group Library 1994 August
/
wc-cdrom-cusersgrouplibrary-1994-08.iso
/
listings
/
v_08_08
/
8n08072a
< prev
next >
Wrap
Text File
|
1990-07-18
|
620b
|
29 lines
insertion_sort( int data[], int first, int last )
{
int i;
int j;
int temp;
for ( i=first+1 ; i <= last ; i++ )
{
temp = data[i];
j = i-1;
while (j >= first)
{
if ( data[j] > temp )
{
data[j+1] = data[j];
j--;
}
else
break;
]
data[ j+1 ] = temp;
}
}
The Insertion Sort
Figure 16