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

正文內(nèi)容

算法設(shè)計(jì)與分析課程設(shè)計(jì)報(bào)告(編輯修改稿)

2025-04-19 12:01 本頁面
 

【文章內(nèi)容簡介】 ,整個(gè)哈夫曼樹的需要的結(jié)點(diǎn)數(shù)為2*num1. { hufftree[i].parent=1。 hufftree[i].lchild=1。 hufftree[i].rchild=1。 } for(int j=0。jnum。j++) { hufftree[j].weight=w[j]。 hufftree[j].str=s[j]。 } for(int k=num。k2*num1。k++) //構(gòu)建哈夫曼樹 { Select(k1,i1,i2)。 //在hufftree中找權(quán)值最小的兩個(gè)結(jié)點(diǎn)i1和i2 hufftree[i1].parent=k。 hufftree[i2].parent=k。 hufftree[k].weight=hufftree[i1].weight+hufftree[i2].weight。 hufftree[k].lchild=i1。 hufftree[k].rchild=i2。 }}//void HuffmanTree::Huffmancode(char wen[]){ ifstream in(wen)。 ofstream out()。 int start=MaxSize1。 int cha=0。 char cd[MaxSize]。 //存放一個(gè)編碼 cd[MaxSize1]=39。\039。 for(int i=0。inum。i++) { start=MaxSize1。 int c,f。 for(c=i,f=hufftree[i].parent。f!=1。c=f,f=hufftree[f].parent) { if(hufftree[f].lchild==c) //置左分支編碼0 cd[start]=39。039。 else cd[start]=39。139。 //置右分支編碼1 } strcpy(hufftree[i].bits,amp。cd[start])。//將編碼存放在相應(yīng)結(jié)點(diǎn)存儲(chǔ)哈夫曼編碼的數(shù)組中 } cout字符在數(shù)組中的下標(biāo)及其編碼如下:。 //輸出字符在數(shù)組中的位置及其編碼 for(int k=0。knum。k++) { if(k%3==0) coutendl。 couthufftree[k].str:hufftree[k].bits39。\t39。 } coutendlendl。 for(char ch。(ch)。) //將逍遙游文件中各個(gè)字符轉(zhuǎn)變成相應(yīng)的編碼,寫入編碼后的文件中 { if((int)ch0) cha=(int)ch+256。 else cha=(int)ch。 for(int j=0。jnum。j++) if(hufftree[j].str==cha) outhufftree[j].bits。 } cout編碼成功!endl。}//
點(diǎn)擊復(fù)制文檔內(nèi)容
高考資料相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖片鄂ICP備17016276號(hào)-1