摘要:
#include<iostream> using namespace std; int r[100]={0}; int n; int Partition(int i,int j){//单趟快速排序 r[0]=r[i]; int x=r[i]; while(i<j){ while(i<j&&r[j]> 阅读全文
摘要:
#include<iostream> using namespace std; int r[100]={0}; int n; void BubbleSort(){ for(int i=1;i<n;i++){ for(int j=i+1;j<=n;j++){ if(r[i]>r[j]){ int te 阅读全文
摘要:
希尔排序是直接插入排序的优化不稳定,nlogn #include<iostream> using namespace std; int r[100]={0}; int n; void ShellSort(){ int d=n/2;//间隔根据实际情况取得 while(d>=1){ for(int i 阅读全文