《数据结构与算法》huffman算法实现.docx
![资源得分’ title=](/images/score_1.gif)
![资源得分’ title=](/images/score_1.gif)
![资源得分’ title=](/images/score_1.gif)
![资源得分’ title=](/images/score_1.gif)
![资源得分’ title=](/images/score_05.gif)
《《数据结构与算法》huffman算法实现.docx》由会员分享,可在线阅读,更多相关《《数据结构与算法》huffman算法实现.docx(2页珍藏版)》请在淘文阁 - 分享文档赚钱的网站上搜索。
1、数据结构与算法huffman算法实现/ huffnian.cpp : Defines the entry point for the console application./#include stdafx.h#includc ,iostream.hM#include *string.hn#define n 4#define in 2*ntypedef struct unsigned int weight;unsigned int parent, Ichild, rchild;JHTNode;typedef HTNode HufTmanTreem;typedef struct char ch;
2、存放字符char bitsn+1J;存放编码位串JCodeNode;typedef CodeNode HuffnianCoden+l;void SelectMin(HuffmanTree T, int i, unsigned int *sl, unsigned int *s2)选取两个权值最小的结点 intj;unsigned int firstminecondmin;firstmin=secondmin=32767;for (j=l; ji; j+) 求最小值if (TjJ.parent=()&(T(jJ.weightfirstmin) (firstmin=Tj.weight;*sl=j;)
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 数据结构与算法 数据结构 算法 huffman 实现
![提示](https://www.taowenge.com/images/bang_tan.gif)
限制150内