sort( a, b )
int a, b;
{int i, j, rlow, rupp, wlow, wupp, InBuff;
typekey MaxLower, MinUpper;
struct rec LastRead;
extern struct rec Buff[];
while ( b>a ) {
rupp = wupp = b;
rlow = wlow = a;
InBuff = 0;
MaxLower = MinimumKey;
MinUpper = MaximumKey;
i = a-1;
j = b+1;
/*** Partition the file ***/
while ( rupp >= rlow ) {
if ( rlow-wlow Buff[M-1].k ) {
if ( LastRead.k > MinUpper ) j = wupp;
else MinUpper = LastRead.k;
WriteDirect( wupp--, LastRead);
}
else if ( LastRead.k 0 ) WriteDirect( wupp--, Buff[--InBuff] );
/*** sort the shortest subfile first ***/
if (i-a |