CS 340 - Software Design

Spring 2012


Project 2 - File Compression

Due: Thursday, February 16, 2012 at 11:59 pm

For this assignment, you are to use the Huffman Coding algorithm to create a file compression/decompression utility. We will use a static Huffman Tree, based on the HTML file const.html which is from the web site http://www.usconstitution.net/. While this file is large, it does not use all of the ASCII characters (for example: capital Z does not appear in the file). Since we are using a static Huffman Tree (we will encode all files using the same tree), we need to make sure that all possible characters are included. For more information check out the Wikipedia page on Huffman Coding or http://www.data-compression.com/lossless.shtml]].

Your project is to preform three tasks:

  1. Create the Huffman Tree information
  2. Use the information from part 1 to compress a file
  3. Use the information from part 1 to uncompress a file.
Each of these tasks is to be done in its own program. I.E. You will be creating 3 executable programs for this project. To keep things somewhat uniform, the three programs are to be called:
  1. createTree
  2. hcompress
  3. huncompress
The program to create the Huffman tree information should take the name of a file as a command line argument. The ASCII characters from this file will be used do determine the frequency of the characters as needed when building the Huffman tree. This program is to write out to a file (or files) the information that will be used by the compress program and the uncompress program. The names of the output file(s) will be hardcorded in your program and you may assume that their names will not conflict with other files.

The program to compress a file will take the name of the file that is it to compress as a command line argument. The program will create a file that contains the compressed information. This new file's name will add a ".H" to the filename of original file. The information needed to compress the file will be read from the file written by first program. The filename of the file containing this information will be hardcorded in your program.

The program to uncompress a file will take the name of the file to be uncompress as a command line argument. The name of the file must end with a ".H". The resulting file should use the name of the compressed file without the .H ending. The information needed to uncompress the file will be read from the file written by first program. The filename of the file containing this information will be hardcorded in your program.

If any of the three programs is not given a command line argument, you are to prompt the user for the apropriate information.

Project Requirements

  • For this project, you are NOT allowed to use any classes from the C++ Standard Template Library nor libraries from the Qt Library expect with explicit permission from the instructor.

  • This project requires the use of a programmer-written binary tree class using dynamic memory allocation.

  • This project requires the use of multiple source code files.

Submission of the Program

You are to submit the program via the submission link in Blackboard. Note via turnin. Sorry for any confusion on thi.

CS 340 - Fall 2010

Topic attachments
I Attachment Action Size Date Who Comment
HTMLhtml const.html manage 75.2 K 2012-01-31 - 19:46 UnknownUser US Constitution
Topic revision: r3 - 2012-02-14 - 18:14:59 - Main.troy
 
Copyright 2016 The Board of Trustees
of the University of Illinois.webmaster@cs.uic.edu
WISEST
Helping Women Faculty Advance
Funded by NSF