Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Compressing Data using Huffman Coding: Part 1: Build a Frequency Table The first task is to build a frequency table. Please refer to the example

image text in transcribedimage text in transcribedimage text in transcribed

Compressing Data using Huffman Coding: Part 1: Build a Frequency Table The first task is to build a frequency table. Please refer to the example in Table 1. At this point, you should fill the first two columns of this table: Character and Frequency. The Huffman code is not known yet. In this table: Items include characters that appear only in the input string. Characters are case sensitive Characters are listed in the order of appearance in the input string The minimum number of characters is 2 The frequency refers to the number of appearances of the character. You do not need to normalize this number. 1. 2. 3. 4. 5. Part 2: Build a Huffman Coding Tree Follow the algorithm and build a Huffman coding tree based on the information stored in the frequency table. Use a priority queue as explained in the slides. Part 3: List the Huffman Codes Based on the Huffman Coding tree built in the part 2, you should create the Huffman codes for each of the characters that appear in the input string. Please note that you DO NOT need to perform bit operations in this assignment. Please store the encoded information as a String object. For example, to represent the bit stream "11110000", you can create a String object with a new String "11110000". String huffmanCode -"11110000"; The Huffman code should be stored in the corresponding column of the Frequency Table. Compressing Data using Huffman Coding: Part 1: Build a Frequency Table The first task is to build a frequency table. Please refer to the example in Table 1. At this point, you should fill the first two columns of this table: Character and Frequency. The Huffman code is not known yet. In this table: Items include characters that appear only in the input string. Characters are case sensitive Characters are listed in the order of appearance in the input string The minimum number of characters is 2 The frequency refers to the number of appearances of the character. You do not need to normalize this number. 1. 2. 3. 4. 5. Part 2: Build a Huffman Coding Tree Follow the algorithm and build a Huffman coding tree based on the information stored in the frequency table. Use a priority queue as explained in the slides. Part 3: List the Huffman Codes Based on the Huffman Coding tree built in the part 2, you should create the Huffman codes for each of the characters that appear in the input string. Please note that you DO NOT need to perform bit operations in this assignment. Please store the encoded information as a String object. For example, to represent the bit stream "11110000", you can create a String object with a new String "11110000". String huffmanCode -"11110000"; The Huffman code should be stored in the corresponding column of the Frequency Table

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions