Using Huffman code, we can compress the bits used for saving the characters in a file: (The Table is in Image Attachment) Total bits used for saving the character in table 1 is 264 bits using standard ASCII 8 bits for 1 character. Using Huffman code encoding in Table 2, the total bits used is 126 bits. The problem: ➢ Input: list of characters such as table 1 ➢ Output: total bits using Huffman code encoding (table 2) ➢ Task: Design an algorithm in pseudocode/code to print the total bits using Huffman code encoding and write down the Algorithm analysis. The complexity of the algorithm must be in O(n) and proof it! ➢ PS: you don’t need to sort the input since the input is already sorted!

Systems Architecture
7th Edition
ISBN:9781305080195
Author:Stephen D. Burd
Publisher:Stephen D. Burd
Chapter3: Data Representation
Section: Chapter Questions
Problem 26VE
icon
Related questions
Question
100%

Using Huffman code, we can compress the bits used for saving the characters in a file:

(The Table is in Image Attachment)


Total bits used for saving the character in table 1 is 264 bits using standard ASCII 8 bits for 1 character.
Using Huffman code encoding in Table 2, the total bits used is 126 bits.


The problem:
➢ Input: list of characters such as table 1
➢ Output: total bits using Huffman code encoding (table 2)
➢ Task: Design an algorithm in pseudocode/code to print the total bits using Huffman code
encoding and write down the Algorithm analysis. The complexity of the algorithm must be in
O(n) and proof it!
➢ PS: you don’t need to sort the input since the input is already sorted!

Table 2. Character bit using Huffman code
Character
Table.1. Characters count.
Character Frequency
Bits
Frequency
Total
1
Bits
F
1
Space
3
4
12
A
3
4
12
H
1
3
4
12
1
D
4
R
1
4
1
4
12
1
L
4
8
D
2
N
4
12
4
8
Y
4
1
4
1
1
1.
Space
4
M
1
A
4
R
1
4
1
Total:
126
Transcribed Image Text:Table 2. Character bit using Huffman code Character Table.1. Characters count. Character Frequency Bits Frequency Total 1 Bits F 1 Space 3 4 12 A 3 4 12 H 1 3 4 12 1 D 4 R 1 4 1 4 12 1 L 4 8 D 2 N 4 12 4 8 Y 4 1 4 1 1 1. Space 4 M 1 A 4 R 1 4 1 Total: 126
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Knowledge Booster
Huffman coding
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Systems Architecture
Systems Architecture
Computer Science
ISBN:
9781305080195
Author:
Stephen D. Burd
Publisher:
Cengage Learning