#include "stdio.h"
#include "string.h"
#include "windows.h"
int partition( int * a, int * pos, int p, int r )
{
int x = a[p];
int px = p;
int i = p, j = r + 1;
int temp;
while ( 1 )
{
while ( a[++i] > x && i < r );
while ( a[--j] < x );
if ( i >= j )
break;
temp = a[i];
a[i] = a[j];
a[j] = temp;
temp = pos[i];
pos[i] = pos[j];
pos[j] = temp;
}
a[p] = a[j];
a[j] = x;
pos[p] = pos[j];
pos[j] = px;
return j;
}
void MySort( int * a, int * p......
阅读全文