CSIS 1119B/C Introduction to Data Structures and Algorithms
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的更多相关文章
- CSC 172 (Data Structures and Algorithms)
		
Project #3 (STREET MAPPING)CSC 172 (Data Structures and Algorithms), Spring 2019,University of Roche ...
 - 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 ...
 - [Data Structures and Algorithms - 1] Introduction & Mathematics
		
References: 1. Stanford University CS97SI by Jaehyun Park 2. Introduction to Algorithms 3. Kuangbin' ...
 - 剪短的python数据结构和算法的书《Data Structures and Algorithms Using Python》
		
按书上练习完,就可以知道日常的用处啦 #!/usr/bin/env python # -*- coding: utf-8 -*- # learn <<Problem Solving wit ...
 - 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 ...
 - 学习笔记之Problem Solving with Algorithms and Data Structures using Python
		
Problem Solving with Algorithms and Data Structures using Python — Problem Solving with Algorithms a ...
 - 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 ...
 - Persistent Data Structures
		
原文链接:http://www.codeproject.com/Articles/9680/Persistent-Data-Structures Introduction When you hear ...
 - Algorithms & Data structures in C++& GO ( Lock Free Queue)
		
https://github.com/xtaci/algorithms //已实现 ( Implemented ): Array shuffle https://github.com/xtaci/al ...
 
随机推荐
- dos.orm
			
引言: Dos.ORM(原Hxj.Data)于2009年发布.2015年正式开源,该组件已在数百个成熟项目中应用,是目前国内用户量最大.最活跃.最完善的国产ORM.初期开发过程中参考了NBear与My ...
 - MySQL -- 关闭 binlog
			
LNMP一键安装包安装的MySQL默认是开启了日志文件的,如果数据操作比较频繁就会产生大量的日志,在/usr/local/mysql /var/下面产生mysql-bin.0000* 类似的文件,而且 ...
 - [NOI2015]软件包管理器-树链剖分
			
#include<bits/stdc++.h> using namespace std; const int maxn = 1e6+5; int n,m; int e,begin[maxn ...
 - 51nod--1072 威佐夫游戏 (博弈论)
			
题目: 1072 威佐夫游戏 基准时间限制:1 秒 空间限制:131072 KB 分值: 0 难度:基础题 收藏 关注 有2堆石子.A B两个人轮流拿,A先拿.每次可以从一堆中取任意个或从2堆中取相同 ...
 - Python-Django-Ajax
			
什么是Ajax: 通过js语言跟后台进行交互的一个东西 -特点:异步,局部刷新 ajax往后台提交数据 $.ajax({ url:'请求的地址', type:'get/post', data:{key ...
 - Python——plot可视化数据,作业8(python programming)
			
subject1k和subject1v的形状相同 # -*- coding: utf-8 -*- import scipy.io as sio raw_K = sio.loadmat('Subject ...
 - mysql 表结构及基本操作
			
说明在mysql语句中,sql语句总共分四种 a.DDL数据定义语句=>常用的ddl语句有(CREATE[创建],DROP[删除],ALTER[修改表结构]) b.DML数据操作语句=>常 ...
 - js分析 猫_眼_电_影 字体文件 @font-face
			
0. 参考 https://developer.mozilla.org/zh-CN/docs/Web/CSS/@font-face 这是一个叫做@font-face 的CSS @规则 ,它允许网页开发 ...
 - ABP给WebApi添加性能分析组件Miniprofiler
			
在ABP的WebApi中,对其性能进行分析监测是很有必要的.而悲剧的是,MVC项目中可以使用的MiniProfiler或Glimpse等,这些都不支持WebApi项目,而且WebApi项目通常也没有界 ...
 - Codeforces 750E New Year and Old Subsequence 线段树 + dp (看题解)
			
New Year and Old Subsequence 第一感觉是离线之后分治求dp, 但是感觉如果要把左边的dp值和右边的dp值合起来, 感觉很麻烦而且时间复杂度不怎么对.. 然后就gun取看题解 ...