博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
CSIS 1119B/C Introduction to Data Structures and Algorithms
阅读量:6212 次
发布时间:2019-06-21

本文共 2134 字,大约阅读时间需要 7 分钟。

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.)

因为专业,所以值得信赖。如有需要,请加QQ99515681 或邮箱: 

微信:codinghelp

转载于:https://www.cnblogs.com/simplepython/p/10746591.html

你可能感兴趣的文章
Node项目之评分系统(三)- Web开发
查看>>
Leetcode 9. Palindrome Number
查看>>
从Handler.post(Runnable r)再一次梳理Android的消息机制(以及handler的内存泄露)
查看>>
[LintCode/LeetCode] Decode Ways [String to Integer]
查看>>
eclipse的学习
查看>>
Canvas制作的下雨动画
查看>>
ubuntu16.04安装Ulipad
查看>>
当我们谈网络时,我们谈些什么(4)-- TCP和UDP
查看>>
同步和异步、阻塞和非阻塞的区别
查看>>
Python数据分析入门之pandas总结基础(一)
查看>>
[LintCode] Invert Binary Tree
查看>>
Array.from的妙用
查看>>
使用Digitalocean搭建Ghost博客
查看>>
盟友说 | 在微信中最爆火的应用 后台数据究竟什么样?
查看>>
TIOBE 7 月编程语言榜:TypeScript 进入前 50 名
查看>>
iView 3.3.1 发布,基于 Vue.js 的企业级 UI 组件库
查看>>
Wekan 2.23 发布,支持中文的 JavaScript kanban
查看>>
微软力挺 Go,宣布参与 Athens 项目和 GopherSource
查看>>
开源监控软件之争
查看>>
vsftpd安装以及配置FTP虚拟用户实践
查看>>