Question
Asked Oct 11, 2019
105 views

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).

check_circle

Expert Answer

Step 1

a)

Constructing Hauffman code for the given data:

help_outline

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

fullscreen
Step 2
help_outline

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

fullscreen
Step 3
help_outline

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

fullscreen

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

Engineering

Computer Science

Related Computer Science Q&A

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

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 ...

question_answer

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...

question_answer

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...

question_answer

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...

question_answer

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...

question_answer

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...

question_answer

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...

question_answer

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

question_answer

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 ...