⺣ - רҵ·ĵϷƽ̨

ǰλãҳ > 数据结构专业课程设计十种排序算法比较样本 - 百度文库

数据结构专业课程设计十种排序算法比较样本 - 百度文库

  • 62 Ķ
  • 3
  • 2025/6/20 1:50:46

=\}

void BeforeSort()//ʼ { p=0;q=0; }

void quicksort(sqlist r,int s,int t) {

int i=s,j=t; if(s

r[0]=r[s];p++; while(i

while(i=r[0].key) j--; r[i]=r[j]; q++; p++;

p++;

while(i

r[j]=r[i];q++;p++; }

r[i]=r[0];p++; } else return; quicksort(r,s,j-1); quicksort(r,j+1,t); }

void sort(sqlist r,int s,int t) {

BeforeSort(); quicksort(r,s,t); display(p,q); }

//2-·

void sort3(sqlist nu,int n)

{//int max=n; #define max 20

int first,final;//ͷβָ

int cache[max+1];//תվ

int i,j,s=0;//i,jѭ k int t=0;

for(i=0;i

if(0==i) {

first=0;

final=0;

cache[0]=nu[0].key; } else {

if(nu[i].key>=cache[final]) {t++;

final++;

cache[final]=nu[i].key; s++; }

else if(nu[i].key<=cache[first])

  • ղ
  • Υٱ
  • Ȩ
ĵ10.00 Ԫ VIP
ߣ...

92ƪĵ

ĵ飺

=\} void BeforeSort()//ʼ { p=0;q=0; } void quicksort(sqlist r,int s,int t) { int i=s,j=t; if(s

οͿͨغɸƺŰ棩
ƪ
ʱؼۣ10 Ԫ/ ԭ:20Ԫ
VIP
ؼۣ29 Ԫ/ ԭ:99Ԫ
0.3 Ԫ/ ÿ150
ȫվɸ
VIP
ؼۣ29 Ԫ/ ԭ:99Ԫ
0.3 Ԫ/ ÿ150
ȫվɸ
עĵпܡֻĿ¼ݲȫ֮ǰעѸ޷ػ⣬ϵЭ㴦
΢ţfanwen365 QQ370150219
Copyright © ⺣ All Rights Reserved. ICP16052595-3 վͼ ͷQQ370150219 䣺370150219@qq.com