[SOLVED] ADS - Data Compression using Huffman’s algorithm

30.00 $

Programming resource
Digital learning resource
Category:
✓ Practical programming resource
✓ Suitable for guided study and reference
✓ Tutor guidance available when needed

Description

5/5 - (1 vote)

See the description of this problem in the book for further details.

Write a program that implements Huffman’s algorithm for Data Compression. Please refer to the slides for a description of the algorithm.

Your program should read a (large) text from a file, ideally a text with at least two pages. In the first pass you should build a frequency table for each letter/character, including blank space and punctuation signs.

You should then implement a coding/decoding function, based on the Huffman coding method. The output for the coding phase should be in a file, consisting of a preamble and the encoded version of the text.

The preamble should consist of a sequence of lines of type

<character/symbol><codeword> one for each character/symbol (appearing in the text), followed by a blank

line, then the encoded text.

The decoded file should just print the result of the decoding process.

 

Resource details

Understand the Task Before You Use the Resource

Review the requirements, identify the programming concepts involved, study the implementation and test your understanding with your own examples and modifications.