資源簡介
實現哈夫曼樹的創建、編碼 譯碼和輸出功能
代碼片段和文件信息
??#include??????
??#include??????
??#include??????
??#include??????
??#include?????
??#define?MAXN?500
??typedef???struct?
??{???
????int???weight;???
????int???parent;
????int???lchild;
????int???rchild;???
??}???HTNode*HuffmanTree;???
????
??typedef???char???**HuffmanCode;???
????
??typedef???struct???{???
????int???s1;???
????int???s2;???
??}???MinCode;???
????
?MinCode???Select(HuffmanTree???HT??int???n)???
??{???
????int???minsecmin;???
????int???temp;???
????int???is1s2tempi;???
??MinCode???code;???
??s1=1;s2=1;???
??for(i=1;i<=n;i++)???
??if(HT[i].parent==0)???
??{???
??min=HT[i].weight;???
??s1=i;???
??break;???
??}???
??tempi=i++;???
??for(;i<=n;i++)???
??if(HT[i].weight
- 上一篇:C語言實現FFT(快速傅里葉變換
- 下一篇:VC++藥品管理系統
評論
共有 條評論