09 2021 档案
1.直接插入排序
摘要:#include<stdio.h> void Insert(int A[],int n){ int i,j,temp; for(i=1;i<n;i++) { temp=A[i]; for(j=i-1;j>=0&&A[j]>temp;j--){ A[j+1]=A[j]; } A[j+1]=temp;
阅读全文
50.快速排序
摘要:#include<stdio.h> int Partition(int A[],int low,int high) { int pivot=A[low]; while(low<high) { while(low<high&&A[high]>=pivot) --high; A[low]=A[high]
阅读全文
47.插入排序
摘要:#include<stdio.h> void InsertSort(int A[],int n){ int i,j,temp; for(i=1;i<n;i++) { if(A[i]<A[i-1]) { temp=A[i]; for(j=i-1;j>=0&&A[j]>temp;j--) { A[j+1
阅读全文