排序——快速排序(尾递归优化) #include <iostream> #include <stdlib.h> using namespace std; #define MAX_LENGTH_INSERT_SORT 7 #define MAXSIZE 10 void ISort( int k[], int n ) { int i, j,temp; for( i=1; i < n;i++ ) { if...
}voidInserSort(intk[],intlow,inthigh) { ISort(k+low, high-low+1); }voidswap(intk[],intlow,inthigh) {inttemp; temp=k[low]; k[low]=k[high]; k[high]=temp; }intPartition(intk[],intlow,inthigh) {intpoint;intm = low + (high - low)/2;if(k[low] >k[high]) { swap(k,...