free geoip

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
CS502 Fundamentals of Algorithms Assignment No. 03 solution 20th January 2016
VU Help • House Banner VU Help Virtual University Students - Assignments, Solved Papers, GDB & Exam Help Student Help Forum • Collaborative • Free Support
#1
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.

0300-9520262
Get solution in 24 hour
|cpmputer & internetConfusedmileys81:[SIZE="4"][SIZE="3"]....[/SIZE][/SIZE]
Reply
#2
Solution :

ypically characters are encoded by fixed length binary words. ASCII code uses 8 bits and Unicode uses 16 bits. Huffman encoding uses variable bit length words to encode the characters. Characters used more frequently have smaller length. In this way the encoding of string can be smaller then with fixed length words.
The Huffman code uses a binary tree to describe the code. Each letter of the alphabet is located at an external. The bit encoding is the path from the root to the letter with moving to the left child generating a 0 and moving to right child generating a 1. If we are actually using the tree to encode the text then we would need an additional locater structure. Normal one would make a lookup table and use the tree only to construct/determine the code. The tree is a satisfactory structure to decode.

0300-9520262
Get solution in 24 hour
|cpmputer & internetConfusedmileys81:[SIZE="4"][SIZE="3"]....[/SIZE][/SIZE]
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  CS301 Assignment # 4 Due Date: 02-Feb-2016 Vuhelper 0 2,356 02-03-2016, 05:38 PM
Last Post: Vuhelper
  CS703 – Advanced Operating Systems Assignment No.3 solution January 2016 Vuhelper 0 5,944 01-23-2016, 09:58 PM
Last Post: Vuhelper
  CS601 Data Communication Assignment No. 03 Solution 23rd January 2016 Vuhelper 1 1,972 01-23-2016, 06:09 PM
Last Post: Vuhelper
  CS403 Assignment No. 03 Solution 23rd January 2016 Vuhelper 2 1,213 01-23-2016, 03:18 PM
Last Post: Vuhelper
  CS506 Web Design and Development Assignment no 3 Solution 3rd January 2016 Vuhelper 0 2,280 01-23-2016, 03:16 PM
Last Post: Vuhelper
  CS724 Software Process Improvement Assignment No 01 Solution 20th January 2016 Vuhelper 0 2,010 01-20-2016, 06:26 PM
Last Post: Vuhelper
  CS711 Software Design Assignment No 01 Solution Due Date Feb 12, 2016 Vuhelper 0 1,702 01-20-2016, 06:24 PM
Last Post: Vuhelper
  CS709 Formal Methods for Software Engineering Assignment No 01 Solution January 2016 Vuhelper 0 1,839 01-20-2016, 06:22 PM
Last Post: Vuhelper
  cs703 assignment no 3 Solution 20th January 2016 Vuhelper 0 1,739 01-20-2016, 06:20 PM
Last Post: Vuhelper
  CS704 Assignment No. 01 Solution January 2016 Vuhelper 0 4,835 01-20-2016, 06:19 PM
Last Post: Vuhelper

Forum Jump:


Users browsing this thread: 1 Guest(s)
VU Help • House Banner VU Help Virtual University Students - Assignments, Solved Papers, GDB & Exam Help Student Help Forum • Collaborative • Free Support