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

正文內(nèi)容

數(shù)據(jù)結(jié)構(gòu)課程設(shè)計(jì)報(bào)告-其他專業(yè)(已改無錯(cuò)字)

2023-03-03 12:00:42 本頁面
  

【正文】 eturn。 } /*函數(shù)功能:將終端輸入的字符串編譯成用 0/1 表示的編碼,并將相應(yīng)信息存入 TXT 文檔。 函數(shù)參數(shù): temp[1000],用于臨時(shí)存儲(chǔ)終端輸入的字符串。 Code[1000],用于存儲(chǔ) 0/1 編碼。 ,用于存儲(chǔ)終端輸入的字符串。 ,用于存儲(chǔ)編譯后的 0/1 編碼。 函數(shù)返回值:無 */ void Encoding() { int i,j,all。 char temp[1000],code[10000]。 printf(Please put in the sentence you want to Encoding:)。 //scanf(%s,temp)。 getchar()。 gets(temp)。 code[0]=39。\039。 FILE* FToBeTranP=NULL。 if(NULL==(FToBeTranP=fopen(E:\\,w))) printf(Open failed!\n)。 else fputs(temp,FToBeTranP)。 fclose(FToBeTranP)。 TempLen=strlen(temp)。 for(i=0。iTempLen。i++) { all=0。 for(j=1。j=n。j++) { 10 if(temp[i]==HT[j].elem) { strcat(code,HC[j])。 all=1。 } } if(all=0) printf(Some charactor in the sentence are not matching!!!)。 } code_num=strlen(code)。 printf(Codes of the sentence are:\n%s\n,code)。 FILE* FCodeFileP=NULL。 if(NULL==(FCodeFileP=fopen(E:\\,w))) printf(Open failed!\n)。 else fputs(code,FCodeFileP)。 fclose(FCodeFileP)。 printf(And have put into E:\\!\n)。 return。 } //Decoding void Decoding() { int m,i,p=0。 char q,*Decode,*Sentence。 FILE* FDecodeP=NULL。 if(NULL==(FDecodeP=fopen(E:\\,r))) printf(Open E:\\ failed!\n)。 else { FILE *TxtFile=NULL。 if(NULL==(TxtFile=fopen(E:\\,w))) printf(Open E:\\ failed!\n)。 else { Sentence=(char*)malloc(TempLen*sizeof(char))。 Decode=(char*)malloc(code_num*sizeof(char))。 fgets(Decode,code_num+1,FDecodeP)。 m=2*n1。 11 for(i=0。Decode[i1]!=39。\039。i++) { q=Decode[i]。 if(HT[m].lchild==0) { Sentence[p]=HT[m].elem。 p++。 m=2*n1。 i。 } else if(q==39。039。) m=HT[m].lchild。 else if(q==39。139。) m=HT[m].rchild。 } Sentence[p]=39。\039。 fputs(Sentence,TxtFile)。 printf(Codes have been Encoded and get a sentence:\n%s\n,Sentence)。 printf(And have been put into !\n)。 } } } /* 函數(shù)功能:輸出赫夫曼樹中各結(jié)點(diǎn)的數(shù)據(jù)存儲(chǔ)情況。 函數(shù)參數(shù):無。 函數(shù)返回值:無。 */ void PrintHufmFigue() { int i,m。 char end[]={39。\\39。,39。\039。}。 printf(╔━━━┳━━━┳━━━┳━━━┳━━━┳━━┳━━━━━━━╗ )。 printf(┃ Number┃ Element┃ Weight┃ Parents┃ Lchild┃ Rchild┃ HuffmanCode ┃ )。 printf(┣━━━╋━━━╋━━━╋━━━╋━━━╋━━╋━━━━━━━┫ )。 for(i=1。i=n。i++) { printf( ┃ %6d
點(diǎn)擊復(fù)制文檔內(nèi)容
環(huán)評(píng)公示相關(guān)推薦
文庫(kù)吧 www.dybbs8.com
備案圖片鄂ICP備17016276號(hào)-1