CSIS 1119B/C Introduction to Data Structures and Algorithms
Programming Assignment Two
Due Date: 18 Apr 2019 (Thu) 23:59
You are required to write a Huffman code encoder.

Details:
Name your program as “hmencoder”.
Usage of hmencoder:
hmencoder [input_file]
where input_file is the file containing the input message.
The input message contains normal English text. You need to encode all English letters together with all printable characters such as “.”, “;”, “!”, space etc. The capital letter and the corresponding small letter are treated as two symbols. For example, “A” and “a” are regarded as two symbols.
The output of hmencoder should have two output files, “code.txt” and “encodemsg.txt”.
The output file “code.txt” stores the codewords for each symbol and the average number of bits used for each symbol. The format of this output file is as follows:

代做CSIS 1119B/C作业、代写Data Structures作业、代做Java程序语言作业、代写c/c++,Python实验作业

Each row contains the codeword for a separate symbol, the symbols are listed according to the increasing order of the corresponding ASCII code value. The last row shows the average number of bits used for each symbol.

E.g.

Space: 000
!: 001
...............
A: 0100
...............
z: 1000
Ave = 3.43 bits per symbol

The output file “encodemsg.txt” stores the encoded message with 80 0/1 characters on each row (except the last row).
*Important*: (i) We use the letter with the smallest ASCII code as the representative of a subtree; and (ii) in case of ambiguity, select the two trees with the smallest representatives and when combining the two trees, the one with the smaller representative will be on the left.
A sample input file and the corresponding output files will be given in the course moodle page soon.

Hand in the following (via Moodle):
-The source code and the executable of your program (also specify clearly the environment for which your program can be executed at the beginning of your source code as comments. Failing to do so may receive 0 marks even your program is correct.)

因为专业,所以值得信赖。如有需要,请加QQ:99515681 或邮箱:99515681@qq.com

微信:codinghelp

最新文章

  1. 如何查找本地的ip
  2. SEO实战宝典阅读笔记
  3. ansible执行playbook时间显示的python脚本
  4. LVS三种工作方式八种算法
  5. BabeLua
  6. Navicat导入数据时发生了报错 --- 1153 - Got a packet bigger than 'max_allowed的处理办法
  7. float,double和decimal的精度问题
  8. class_create(),device_create()使用
  9. 【转】iOS开发工具系列(按功能分)
  10. uoj #139. 【UER #4】被删除的黑白树 dfs序 贪心
  11. [原]生产环境下的nginx.conf配置文件(多虚拟主机)
  12. iOS - 文件与数据(File & Data)
  13. POJ2002 Squares(枚举)
  14. 九个Console命令,让 JS 调试更简单
  15. Objective-C内存管理教程和原理剖析(四)
  16. Spring Boot 系列教程5-热部署-devtools模块
  17. P124黎曼可积性刻画 的两个备注
  18. 『Python CoolBook』C扩展库_其二_demo演示
  19. how-to-pass-a-class-variable-to-a-decorator-inside-class-definition
  20. 重读源码,见证HashMap以及它的朋友们的骚操作

热门文章

  1. css-块级格式上下文
  2. QPS/TPS/并发量/系统吞吐量概念和公式
  3. 【原创】大叔问题定位分享(6)Dubbo monitor服务iowait高,负载高
  4. docker 进阶
  5. log4j2使用入门(一)
  6. MATLAB 2012b license checkout failed
  7. Mapreduce的序列化和流量统计程序开发
  8. 关于postman各功能的说明及用法以及批量执行
  9. Django 学习第十一天——中间键和上下文处理器
  10. [nodemon] clean exit - waiting for changes before restart