freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內(nèi)容

綜合排序-數(shù)據(jù)結(jié)構(gòu)課程設(shè)計(jì)-在線瀏覽

2025-03-02 17:40本頁(yè)面
  

【正文】 for(i=1。i++) { temp=a[i]。j0amp。a[j1]temp。 a[j]=temp。 for(i=0。i++) { k=i。jN。 if(k!=i) { int temp。 a[k]=a[i]。 } } }冒泡排序算法核心代碼void BubbleSort(int a[],int p) { int i,j,temp。iN1。ji。 /*進(jìn)行交換,將最小關(guān)鍵字記錄前移*/ a[j]=a[j1]。 }}}創(chuàng)建堆核心代碼void creatheap(int a[],int i,int n) { int j。 t=a[i]。 while(j=n) { if((jn)amp。(a[j]a[j+1])) j++。 i=j。 } else j=n+1。}堆排序核心代碼void heapsort(int a[],int n,int p) { int i。 for(i=n/21。i) creatheap(a,i,n1)。i=1。 a[0]=a[i]。 creatheap(a,0,i1)。 struct node { int low,high。 top++。st[top].high=n1。high=st[top].high。 i=low。 if(lowhigh) { temp=a[low]。amp。 if(ij){a[i]=a[j]。} while(ijamp。a[i]temp)i++。j。 top++。st[top].high=i1。st[top].low=i+1。 } }}時(shí)間部分代碼double TInsertSort(int a[],int p){int i。 for(i=0。i++) b[i]=a[i]。QueryPerformanceFrequency(amp。 LARGE_INTEGER m_liPerfStart={0}。m_liPerfStart)。LARGE_INTEGER liPerfNow={0}。liPerfNow)。 time/=。getchar()。FILE *fp。 for(i=0。i++) fprintf(fp,%d ,b[i])。return(time)。int b[N]。iN。LARGE_INTEGER m_liPerfFreq={0}。m_liPerfFreq)。 QueryPerformanceCounter(amp。 SelectSort(b,p)。getchar()。 QueryPerformanceCounter(amp。 double time= 。printf(\n用直接選擇排序法用的時(shí)間為%f秒;,time)。 fp=fopen(,w)。iN。fclose(fp)。}double TBubbleSort(int a[],int p){int i。for(i=0。i++)b[i]=a[i]。QueryPerformanceFrequency(amp。 LARGE_INTEGER m_liPerfStart={0}。m_liPerfStart)。LARGE_INTEGER liPerfNow={0}。liPerfNow)。 time/=。getchar()。FILE *fp。 for(i=0。i++) fprintf(fp,%d ,b[i])。return(time)。int b[N]。iN。LARGE_INTEGER m_liPerfFreq={0}。m_liPerfFreq)。 QueryPerformanceCounter(amp。heapsort(b,N,p)。 QueryPerformanceCounter(amp。 double time= 。if(p!=6) {Disp(b)。}printf(\n用堆排序法用的時(shí)間為%f秒;,time)。 fp=fopen(,w)。iN。fclose(fp)。}double Tquicksort(int a[],int n,int p){int i。 for(i=0。i++) b[i]=a[i]。QueryPerformanceFrequency(amp。 LARGE_INTE
點(diǎn)擊復(fù)制文檔內(nèi)容
環(huán)評(píng)公示相關(guān)推薦
文庫(kù)吧 www.dybbs8.com
備案圖鄂ICP備17016276號(hào)-1