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. ES6 + Webpack + React + Babel 如何在低版本浏览器上愉快的玩耍

    https://blog.csdn.net/a324539017/article/details/52824189

  2. Lua中的模块与包

    [前言] 从Lua5.1版本开始,就对模块和包添加了新的支持,可是使用require和module来定义和使用模块和包.require用于使用模块,module用于创建模块.简单的说,一个模块就是一个 ...

  3. 翻译NYOJ

    #include<iostream> #include<string.h> #include<stdio.h> using namespace std; ; int ...

  4. .Net Core ----通过XUnit进行接口单元测试(带请求头及参数)并用output输出结果

    最近在做core的接口单元测试,所以在这拿出来分享一下,添加XUnit的nuget包 话不多说,直接上代码了: 输出结果(需要的命名空间using Xunit.Abstractions;): ITes ...

  5. 【原创】大叔问题定位分享(25)ambari metrics collector内置standalone hbase启动失败

    ambari metrics collector内置hbase目录位于 /usr/lib/ams-hbase 配置位于 /etc/ams-hbase/conf 通过ruby启动 /usr/lib/am ...

  6. Array数组小方法总结

    如果各位在阅读的时候,有任何问题,都可以留言: // push()方法会向数据末尾添加数据,并返回添加数据后的数组的长度var arr=[1,2,3]console.log(arr.push(4),a ...

  7. linux 修改history带有时间

    今天在网上学到了给linux的history添加时间.方法如下: 首先已知HISTTIMEFORMAT可以给history设置时间:临时修改直接赋值:HISTTIMEFORMAT="%F % ...

  8. ES6 语法学习(一)

    1.let 和 const 关键字 let 与 var 的区别有: a.let 声明的变量只在当前的块级作用域内有效(块级作用域通俗的话就是被{}包裹起来的区域声明对象的{}例外). b.let 声明 ...

  9. jquery 第三章

    1.回顾$(document).ready(function(){    })$(function(){    }) ID选择器.类选择器.元素选择器层次选择器:空格(上文下:tr td{})属性过滤 ...

  10. jade模板 注意事项

    1.   jade模板 语法 doctype html html head body header div 2.  添加内容:直接在标签后边加空格 直接写内容 如下: div  我要写的内容 3.  ...