內部排序:直接插入排序、選擇排序、冒泡排序、希爾排序、快速排序、堆排序、歸併排序代碼實現(C語言)

#include<stdio.h> #include<stdlib.h> #include<math.h> //直接插入排序 //排序思想:從第二個元素開始,尋找合適的位置存放該元素,一趟排完 void DinsertSort(int array[],int n){ for(int i=1;i<n;i++){//從1開始 int temp=array[i]; int j=i-1;/
相關文章
相關標籤/搜索