Em Andamento

Huffman Compression and Decompression

This case study is about Huffman code trees what the code will do is file compression and decompression.

>> FINAL Required files: [url removed, login to view], [url removed, login to view], [url removed, login to view], [url removed, login to view], [url removed, login to view], [url removed, login to view], [url removed, login to view],

[url removed, login to view], [url removed, login to view], [url removed, login to view]

> compress infile outfile

When run, this program will read the contents of the file named by its first command line argument (infile),

construct a Huffman code for the contents of that file, and use that code to construct a compressed version which is written to a file named by the second command line

argument (outfile). The input file can contain any data (not just ASCII characters) so it should be treated as a binary file.

Your compress program must work for input files up to 10 megabytes in size, so a particular byte value may occur up to 10 million times in the file.

The second part :

> uncompress infile outfile

When run, this program will read the contents of the file named by its first command line argument,

which should be a file that has been created by the compress program. It will use the contents of that file to reconstruct the original,

uncompressed version, which is written to a file named by the second command line argument. In particular, for anyfile F,

after running compress F G uncompress G H it must be the case that the contents of F and H are identical.

Break the problem down:

1- compress program basically needs to go through these steps:

Open the input file for reading.

Read bytes from the file, counting the number of occurrences of each byte value; then close the file.

Use these byte counts to construct a Huffman coding tree.

Open the output file for writing.

Write enough information (a "file header") to the output file to enable the coding tree to be reconstructed when the file is read by your uncompress program.

Open the input file for reading, again.

Using the Huffman coding tree, translate each byte from the input file into its code, and append these codes as a sequence of bits to the output file, after the header.

Close the input and output files.

2- uncompress program should go through these basic steps:

Open the input file for reading.

Read the file header at the beginning of the input file, and reconstruct the Huffman coding tree.

Open the output file for writing.

Using the Huffman coding tree, decode the bits from the input file into the appropriate sequence of bytes, writing them to the output file.

Close the input and output files.

our programs must deal with:

Input files that will be MUCH larger than 1KB

Input files that are not restricted to text files (may be binary files)

Writing compressed files that are actually smaller than the input file.

Habilidades: Programação C++

Ver mais: what is binary tree in c, what is binary tree, what are binary trees, use case sequence, trees beginning with h, study programming, programming with cpp, f trees, data trees, data cpp, c# read and write text file, c programming break, cpp data, binary trees in c, binary trees, binary to text, binary problem, binary code tree, beginning programming, argument programming, study coding, huffman code, h and h, decode a file, data compression

Acerca do Empregador:
( 3 comentários ) San Diego, United States

ID do Projeto: #6617754

Premiar a:

vano101

Hello. I have experience with this assignment, as far as I remember, there is some starter files, isn't it?

$45 USD em 2 dias
(331 Avaliações)
6.4

6 freelancers estão ofertando em média $198 para este trabalho

super2lao

A proposal has not yet been provided

$252 USD in 3 dias
(32 Comentários)
6.0
PerennialWillow

A proposal has not yet been provided

$263 USD in 3 dias
(14 Comentários)
5.0
jasqwerty

It's pretty clear from your project description what goes in [url removed, login to view] and [url removed, login to view] but do you have any guidelines for what exactly the other files need to contain? I have a vague idea from being huffman nodes Mais

$88 USD in 3 dias
(19 Comentários)
4.6
mingzixian523

Hello, sir. I have enough experience in Huffman coding with C++ programming. I can do your task. Thanks. Regards.

$252 USD in 3 dias
(8 Comentários)
3.5
ramiropolla

Oh, please let me do this one. Huffman coding is super fun =). I've worked with data compression on a bunch of different algorithms (specially audio/video for the FFmpeg Open-Source project) for many years.

$100 USD em 1 dia
(4 Comentários)
2.9
nmlemus

I am proffesor of programming at University, the Huffman algorithm is a clasic algorithm in this area, I have many different version of this algoritm, so if you are interesting I can adapt one of those versions for you Mais

$277 USD in 3 dias
(0 Comentários)
0.0