01-20-2016, 03:13 PM
Part 1:
Suppose you are working in an office and want to send a large size text document to your boss via email. Your file is too large for sending as an email attachment as your email service provider allows you to send files only up to a certain size limit.
To cope with this issue, you decided to use Huffman encoding algorithm to compress your document size. Given below is the frequency table for characters used in that document.
Character
Frequency
A
25
D
10
M
30
S
15
T
3
Y
55
Your Task:
Your task is to Create Huffman encoding tree using greedy approach.
10 Marks
Part 2:
In this part, you are provided with working code of Huffman algorithms huffman.cpp. The code is self explanatory and comments are added where necessary. This is a very nice, simple and powerful algorithm for compression.
We have applied this algorithm on two sample statements to get its encoded text. Output for both statements is given below.
You can see input statements and its associated results. Both input statements have same size (448 bits) but size of encoded text is different. You can verify the same results by running given code.
You need to understand the working of Huffman Algorithm. Attached C++ code will help.
You are required to explain the reasons behind difference in encoding/compression results. The first statement “A quick brown…” having size 448 bits was compressed to 259 bits after encoding. While the second statement “admission success…” having same size (448 bits) was compressed to 198 bits after encoding.
Suppose you are working in an office and want to send a large size text document to your boss via email. Your file is too large for sending as an email attachment as your email service provider allows you to send files only up to a certain size limit.
To cope with this issue, you decided to use Huffman encoding algorithm to compress your document size. Given below is the frequency table for characters used in that document.
Character
Frequency
A
25
D
10
M
30
S
15
T
3
Y
55
Your Task:
Your task is to Create Huffman encoding tree using greedy approach.
10 Marks
Part 2:
In this part, you are provided with working code of Huffman algorithms huffman.cpp. The code is self explanatory and comments are added where necessary. This is a very nice, simple and powerful algorithm for compression.
We have applied this algorithm on two sample statements to get its encoded text. Output for both statements is given below.
You can see input statements and its associated results. Both input statements have same size (448 bits) but size of encoded text is different. You can verify the same results by running given code.
You need to understand the working of Huffman Algorithm. Attached C++ code will help.
You are required to explain the reasons behind difference in encoding/compression results. The first statement “A quick brown…” having size 448 bits was compressed to 259 bits after encoding. While the second statement “admission success…” having same size (448 bits) was compressed to 198 bits after encoding.
0300-9520262
Get solution in 24 hour |cpmputer & internet
mileys81:[SIZE="4"][SIZE="3"]....[/SIZE][/SIZE]
