- 12
- 0
- 约1.24万字
- 约 30页
- 2017-06-10 发布于河南
- 举报
北邮数据结构上机实验-哈夫曼树(国外英文资料)
北邮数据结构上机实验-哈夫曼树(国外英文资料)
/ * 2.2 topic 2 - applied experiment
Use binary tree structure to implement haffman/decoder.
Basic requirements:
Initialization (Init) : the ability to count the string s of any length in the input, to count the frequency of each character, and to establish the Huffman tree
Create a coding table (CreateTable) : code with the already built haffman tree and output each characters code.
Encoding (Encoding) : Encoding the input string according to the code table and output the encoded string.
Decoding: use the already built haffman tree to decode the encoded string and output the Decoding results.
Print (Print) : Print the Huffman tree in an intuitive way
Calculate the length of the input string before and after the encoding, and analyze the compression effect of Huffman code.
Binary encoding (optional)
Test data:
I love data Structure, I love Computer. I will try my best to study data Structure.
Tip:
User interfaces can be designed as menu : they can interact.
The frequency of statistics per character in the input string is not present
Characters are not encoded.
3 code requirements
You must have exception handling, such as dropping an exception when you delete an empty linked list.
Maintaining a good style of programming:
? The lines of code and paragraphs should be free and close
? The name of the identifier should be consistent with the meaning of the representation
? The function name should be preceded by a comment indicating the functions function
? The key code should explain its functionality
Does the recursive program pay attention to the calling process to prevent the stack overflow?
* /
# include iostream
# include string
# include iomanip
Using namespace STD.
/ / static trix list, used to store the haffman tree
Struct hnode
{
Char ss; / / the characters of the nodes
Int weight; / / the weight of the node
Int the parent; / / parent pointer
Int lchild; / / the child pointer
Int rchild; / / the child pointer
};
/ / Huffman code ta
您可能关注的文档
- windows主机安全设置(国外英文资料).doc
- Windows各服务作用(国外英文资料).doc
- Windows系统的重要文件一览表(国外英文资料).doc
- winrar参数(国外英文资料).doc
- WinRoute Pro 4.1攻略(国外英文资料).doc
- word文档 乱码 处理(国外英文资料).doc
- WIN7无法登陆(国外英文资料).doc
- Windows Sockets编程(国外英文资料).doc
- wps表格公式大全(国外英文资料).doc
- WR指标说明(国外英文资料).doc
- 河北盐山中学等校2025-2026学年上学期高三一模化学试卷(含解析).docx
- 河北正定中学2025-2026学年高一上学期期末考试物理试卷(含解析).docx
- 河北张家口市怀安县2025-2026学年第一学期期末教学综合评价八年级地理试卷(含解析).docx
- 河南安阳市殷都区2025-2026学年第一学期期末教学质量检测七年级地理试卷(含解析).docx
- 河南安阳市滑县2025一2026学年第一学期期末学业质量监测八年级地理试题(含解析).docx
- 河南安阳市林州市2025-2026学年上学期期末考试高一政治试题(含解析).docx
- 河南焦作市武陟县第一中学2025-2026学年高一上学期1月月考语文试卷(含解析).docx
- 河南济源市2025-2026学年上学期期末学业质量调研七年级历史试卷(含解析).docx
- PICC导管并发症的紧急处理与护理.pptx
- 河南鹤壁市2025-2026学年高二上学期期末考试生物试题(含解析).docx
原创力文档

文档评论(0)