1. 程式人生 > >CSI 403 --- Algorithms and Data Structures

CSI 403 --- Algorithms and Data Structures

CSI 403作業代做、代寫C/C++程式設計作業、代做C/C++語言作業、代寫Data Structures作業
Computer Science – International College
CSI 403 --- Algorithms and Data Structures
Programming Assignment 3 --- Fall 2018 (Draft Copy)

Purpose of the Project
The primary goal of this exercise is to develop a simple tool to both compress and decompress files using the Huffman encoding algorithm. A secondary goal of the exercise is to develop skills for working with heaps, priority queues, and Huffman trees.
To Do
Your solution will use the Huffman coding algorithm to both compress and decompress files. For compression it will create the encoded version of the input file by using the ASCII characters for 0 and 1. This means your compressed output will actually be larger than the original. The idea here is to have a working Huffman algorithm without being concerned with the real low-level implementation of it.

Your Huffman encoding / decoding solution must include the following methods:
1.initializeFromFile(String FileName)
Takes the supplied file name and builds Huffman tree using a Priority Queue as discussed during the lectures. It must also print the number of bytes read. It may also use this function to compute and print the character frequency counts.

2.encodeFile(String InFile, String OutFile)
Takes the supplied file names and encodes the InFile, placing the result in the OutFile. It also must check to make sure initializeFromFile has been executed. It must also print both input and output byte count and compute the size of the ENCODED file as a percentage of the size of the ORIGINAL file (level of compression).

3.decodeFile(String InFile, String OutFile)
Takes the supplied file names and decodes the InFile, placing the result in the OutFile. It also checks to make sure initializeFromFile has been executed. It must also print the number of bytes received as well as the number of bytes resulting from the decoding.

You are to include the following Code Structure in your solution.
int huffmanCode(String args)
{
Huffman T;
T.InitializeFromFile("c:\\FileToBeProcessed.txt");
T.EncodeFile("c:\\FileToBeProcessed.txt", "c:\\FileToBeProcessed.enc");
T.DecodeFile("c:\\FileToBeProcessed.enc", "c:\\FileToBeProcessed.dec");
return 0;
}
Testing your result
From the command line window you are to use fc /b will compare the two files.
prompt> fc /b C:\ FileToBeProcessed.txt C:\ FileToBeProcessed.dec
should show “no differences found” if both your encoder and decoder work well from end-to-end.


You are to use the C++ programming language for this exercise. An additional document providing information regarding the documentation to be submitted for the solution of your assignment will be made available as a separate document.

Due Date
Due by 11:59 PM, Wednesday, December 5th, 2018.

How to Submit your Work
?Your solutions must be submitted to the address provided by your co-instructor.
?Your files for the Project 3 must include the source code for all modules used for the exercise as well as an executable file to allow your solution to be tested. You must include all your source files in a Compressed (zipped) folder (.zip). Your (.zip) folder as well as the subject of your message must follow the format: Project 3 Your Name. Marks will be deducted if you do not follow this requirement.

因為專業,所以值得信賴。如有需要,請加QQ99515681 或郵箱:[email protected] 

微信:codinghelp