Asked Oct 11, 2019

a. Construct a Huffman code for the following data:

Symbol A L I Z P
Frequency 4.5 .5 3.0 1.0 1.0

b. Encode PLAZA using the code of part (a).

c. Decode 10011101110110 using the code of part (a).


Expert Answer

Step 1


Constructing Hauffman code for the given data:


Image Transcriptionclose

1. Build a min heap that contains 5 nodes Symbol A Frequency 4.5 Z P 0.5 3.0 1.0 1.0 2. Select the two minimum 0.5 3.0 1.0 1.0 4.5 frequency nodes from min heap that is L and Z P L Z I

Step 2

Image Transcriptionclose

1.5 3. Calculate the sum of two nodes and add newly generated internal node with frequency L+Z= 0.5+1.0=1.5 4.5 3.0 0.5 1.0 1.0 Z L 1.5 4.0 4. Calculate the sum of two nodes and add newly generated internal node with frequency 1.5+4.0=5.5 3.0 I 0.5 1.0 1.0 4.5 Z L P A

Step 3

Image Transcriptionclose

5.5 4.5 5. Calculate the sum of two nodes and dd newly generated internal node with frequency 1.5+4.0=5.5 A 4.0 1.5 1.0 Z 1.0 3.0 0.5 L P 10.0 4.5 5.5 6. Calculate the sum of two nodes and add newly generated internal node with frequency 5.5+A=10,0 A 1.5 4.0 0 0 0.5 3.0 1.0 10 L Z P


Want to see the full answer?

See Solution

Check out a sample Q&A here.

Want to see this answer and more?

Solutions are written by subject experts who are available 24/7. Questions are typically answered within 1 hour.*

See Solution
*Response times may vary by subject and question.
Tagged in


Computer Science

Related Computer Science Q&A

Find answers to questions asked by student like you
Show more Q&A

Q: Write a Java class, XXX_Lab7-3, where XXX is your Kean email ID. In the main method:* Create an arra...

A: Writing a java Program to create a class name XXX_Lab7-3. In this program there are two arrays, one ...


Q: Please explain how you solve the follwing problem:

A: a) Set of nullable variables is {A, B, C} as A and C will be null for productions A -> λ and C-&g...


Q: Is there anything wrong with my code? If so, explain and provide a remedy.     int SIZE = 25;     do...

A: Note:The given code is executed in C++. If you wants this program code to be executed and cleared wi...


Q: what is the classification of the numbering system for computers?

A: Numbering system: This is the approach which is used to represent the numbers in computer architectu...


Q: What type of technique is used when an image is transferred by forcing ink through fine mesh or silk...

A: SerigraphySerigraphy also known as screen printing or silkscreen printing is a printing technique wh...


Q: Boolean Logic Draw the truth table for the following functions: F(A,B)=AB+(A+B) F(A,B,C)=AB+BC+...

A: Hey, since there are multiple questions posted, we will answer first question. If you want any speci...


Q: Given three int variables that have been given values, areaCode, exchange, and lastFour, write a str...

A: As you have not specified the programming language, we are solving this question using C++ programmi...


Q: A 12-bit (8,4) Hamming code whose hexadecimal value is 0xE4F arrives at a receiver. What was the ori...

A: Answer:0xE4F = 111001001111


Q: Write a program in Java Eclipse that does the following:a) create a 2D Ragged array with columns and...

A: Create a Main class and all required methods to print Ragged array elements. And create all methods ...