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

正文內(nèi)容

數(shù)據(jù)結(jié)構(gòu)哈夫曼編碼實驗報告-文庫吧

2025-07-06 12:03 本頁面


【正文】 axleaf*21typedef struct { int weight。 int parent。 int lchild。 int rchild。 char inf。}HNodeType。struct HcodeType{ int bit[MaxBit]。 int start。}。void Creat_Haffmantree(int amp。n){ HNodeType *HaffNode=new HNodeType[2*n1]。 int i,j。 int m1,m2,x1,x2。 for(i=0。i2*n1。i++) { HaffNode[i].weight=0。 HaffNode[i].parent=1。 HaffNode[i].lchild=1。 HaffNode[i].rchild=1。 HaffNode[i].inf=39。039。 } for(i=0。in。i++) { cout請輸入字符endl。 cinHaffNode[i].inf。 cout請輸入該字符的權(quán)值endl。 cinHaffNode[i].weight。 } for(i=0。in1。i++)//構(gòu)造哈夫曼樹 { m1=m2=Maxvalue。 x1=x2=0。 for(j=0。jn+i。j++)//選取最小和次小 { if(HaffNode[j].parent==1amp。amp。HaffNode[j].weightm1) { m2=m1。 x2=x1。 m1=HaffNode[j].weight。 x1=j。 } else { if(HaffNode[j].parent==1amp。amp。HaffNode[j].weightm2) { m2=HaffNode[j].weight。 x2=j。 } } } //將找出的最小和次小合并,創(chuàng)造其父母結(jié)點 HaffNode[x1].parent=n+i。 HaffNode[x2].parent=n+i。 HaffNode[n+i].weight=HaffNode[x1].weight+HaffNode[x2].weight。 HaffNode[n+i].lchild=x1。 HaffNode[n+i].rchild=x2。 HaffNode[n+i].inf=NULL。 } cout顯示存儲的哈弗曼樹信息:endl。 cout權(quán)值 左孩子 右孩子 雙親endl。 for(i=0。i2*n1。i++) { coutHaffNode[i].weight 。 coutHaffNode[i].lchild 。 coutHaffNode[i].rchild 。 coutHa
點擊復制文檔內(nèi)容
環(huán)評公示相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖鄂ICP備17016276號-1