与快速分区函数合并的合并函数代码:
三个函数:
基准函数: intgetStandard(intarray[],int low,int high () ) ) ) ) ) ) ) ) ) )。
(返回基准位置的下标)
递归排序函数: voidquicksort(intarray[],int low,int high ) ) ) ) ) ) ) ) )。
主函数: int main ()。
# include stdio.h # include stdlib.hvoiddisplay (int * array,int size ) { for } inti=0; i size; I ) {printf('%d ',array[i] ); }printf((n ); }intgetStandard(intarray (,int i,int j ) )//基准数据intkey=array ); while(Ij )//默认标准为从左开始,因此从右开始比较) /如果团队末尾的元素大于或等于基准数据,则j指针while ) Ijarray[j]=key ) j--; 如果发现小于array[i],则将后续值array[j]设置为其if[Ij]{array[I]=array[j]; (//如果队伍的起始要素小于或等于基准数据,则继续向后移动I指针while(I