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

CSIS 1119B/C Introduction to Data Structures and Algorithms的更多相关文章

  1. CSC 172 (Data Structures and Algorithms)

    Project #3 (STREET MAPPING)CSC 172 (Data Structures and Algorithms), Spring 2019,University of Roche ...

  2. Basic Data Structures and Algorithms in the Linux Kernel--reference

    http://luisbg.blogalia.com/historias/74062 Thanks to Vijay D'Silva's brilliant answer in cstheory.st ...

  3. [Data Structures and Algorithms - 1] Introduction & Mathematics

    References: 1. Stanford University CS97SI by Jaehyun Park 2. Introduction to Algorithms 3. Kuangbin' ...

  4. 剪短的python数据结构和算法的书《Data Structures and Algorithms Using Python》

    按书上练习完,就可以知道日常的用处啦 #!/usr/bin/env python # -*- coding: utf-8 -*- # learn <<Problem Solving wit ...

  5. 6-1 Deque(25 分)Data Structures and Algorithms (English)

    A "deque" is a data structure consisting of a list of items, on which the following operat ...

  6. 学习笔记之Problem Solving with Algorithms and Data Structures using Python

    Problem Solving with Algorithms and Data Structures using Python — Problem Solving with Algorithms a ...

  7. The Swiss Army Knife of Data Structures … in C#

    "I worked up a full implementation as well but I decided that it was too complicated to post in ...

  8. Persistent Data Structures

    原文链接:http://www.codeproject.com/Articles/9680/Persistent-Data-Structures Introduction When you hear ...

  9. Algorithms & Data structures in C++& GO ( Lock Free Queue)

    https://github.com/xtaci/algorithms //已实现 ( Implemented ): Array shuffle https://github.com/xtaci/al ...

随机推荐

  1. LayUi前端框架删除数据缓存问题(解决删除后刷新页面内容又会显示问题)

    form.on('submit(mySearch)', function(data){ table.reload('userTable', {//就会读取后台数据,重新加载: page: { curr ...

  2. IDEA手动创建JFinal项目

    http://www.jfinal.com/share/674 https://www.oschina.net/question/265150_110300

  3. c++ typeid

    简单使用 #include<iostream> #include<string> #include<new> #include<typeinfo> us ...

  4. 使用 RAII 完成线程等待

    当使用 std::thread 对象执行线程时,必须要调用 join() (或者 detach(),由于 detach() 可以立即调用,所以这里只考虑 join()) #include <io ...

  5. Linux下执行Java程序报错

    在linux下编译java程序,执行javac编译生成class文件时,在centos7终端输入如,javac hello.java    会提示未找到指令,但用java -verison测试环境变量 ...

  6. Fiddler工具使用介绍

    Fiddler基础知识 Fiddler是强大的抓包工具,它的原理是以web代理服务器的形式进行工作的,使用的代理地址是:127.0.0.1,端口默认为8888,我们也可以通过设置进行修改. 代理就是在 ...

  7. Nginx实现URL重写

    本文利用Nginx实现URL重写,本文使用Nginx与静态页面配合重写URL. 1.准备工作. 结合本文场景,需要安装Nginx. 1.1 关于Linux系统安装Nginx可以参考我的文章---(传送 ...

  8. PostgreSQL自学笔记:1 初识 PostgreSQL

    博主教材:李小威.清华大学出版社.<PostgreSQL 9.6 从零开始学> 博主操作系统系统:Windows10 博主PostgreSQL版本:PostgreSQL 9.6 和 Pos ...

  9. php替换字符串函数strtr()和str_repalce()区别

    php中替换函数主要有strtr(),str_repalce()这两个函数,但你们都知道他们这两个函数的区别和用法吗? 先来看看这个php字符串替换函数 strtr()的两种用法: strtr(str ...

  10. Python的numpy库中rand(),randn(),randint(),random_integers()的使用

    1.numpy.random.rand() 用法是:numpy.random.rand(d0,d1,…dn) 以给定的形状创建一个数组,并在数组中加入在[0,1]之间均匀分布的随机样本. 用法及实现: ...