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

正文內(nèi)容

數(shù)據(jù)結(jié)構(gòu)課程設(shè)計(jì)報(bào)告-在線瀏覽

2025-03-07 22:34本頁面
  

【正文】 *關(guān)鍵詞比較次數(shù):pareTimeendl *記錄移動次數(shù):moveTimeendl *排序執(zhí)行時間:(finishstart)msendl *endlendl。} int pareTime=0。 long start,finish。 cout 正在排序...endl。 for(int i=0。i++) { int j=i。kcount。 if(head[j]head[k]) j=k。 head[i]=head[j]。 moveTime+=3。 cout 排序后結(jié)果為:endl。 coutendl *endl *關(guān)鍵詞比較次數(shù):pareTimeendl *記錄移動次數(shù):moveTimeendl *排序執(zhí)行時間:(finishstart)msendl *endlendl。} long start,finish。 //要調(diào)用函數(shù),故使用數(shù)組來記錄關(guān)鍵詞的比較次數(shù)和移動次數(shù),直接進(jìn)行計(jì)數(shù) start=clock()。 qSort(head,0,count,times)。 cout 排序后結(jié)果為:endl。 coutendl *endl *關(guān)鍵詞比較次數(shù):times[0]endl *記錄移動次數(shù):times[1]endl *排序執(zhí)行時間:(finishstart)msendl *endlendl。 T temp=head[m],t=m。 while(head[i]tempamp。i!=n){times[0]++。} j=j1。amp。j。 head[i]=head[j]。 times[1]+=3。 head[m]=head[j]。 times[1]+=3。 qSort(head,j+1,n,times)。} int times[2]={0,0}。 //依據(jù)課本得到希爾排序最優(yōu)的增量遞減序列 long start,finish。 start=clock()。 for(int i=0。i++) { n=seq[i]。 //調(diào)用插入排序算法對同組數(shù)據(jù)進(jìn)行排序 } finish=clock()。 display()。 } 9.//插入排序(被希爾排序shell函數(shù)調(diào)用) void insert(int n,int * times) { //增量為n帶來一系列程序的改動 for(int k=0。k++) { T temp。icount。 j=in。 times[1]++。amp。 head[j+n]=head[j]。 j=n。 head[j+n]=temp。 } } } 10. //堆排序(升序) void hSort() { //堆為完全二叉樹,故可用數(shù)組構(gòu)造堆,且不會造成空間的浪費(fèi) if(isEmpty()){cout 文件中無記錄,無法排序!endl。 T temp。 cout 正在排序...endl。 //初始建堆 for(int i=count/2。i) restore(i,count,times)。i1。 head[0]=head[i1]。 times[1]+=3。 } finish=clock()。 display()。 } //重建堆算法(被堆排序hSort函數(shù)調(diào)用) void restore(int a,int b,int * times) { int mark,j=a。 while(j=b/2) { if(2*jbamp。head[2*j1]head[2*j]) { mark=2*j。 } else { mark=2*j1。 } if(head[mark]head[j1]) { temp=head[mark]。 head[j1]=temp。 times[0]++。 } else { j=b。 } } } //輸出記錄序列(升序) void display() {
點(diǎn)擊復(fù)制文檔內(nèi)容
環(huán)評公示相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖鄂ICP備17016276號-1