Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

explain what is asking because it's too long and too many examples of it. Need help with it. (java) Hopefully the reuploaded pictures are better.

explain what is asking because it's too long and too many examples of it. Need help with it. (java) Hopefully the reuploaded pictures are better.

imageimageimageimageimageimageimageimage

 

HUFFMAN ENCODING LAB "In computer science and information theory, a Huffman code is a particular type of optimal prefix code that is commonly used for lossless data compression. The process of finding and/or using such a code proceeds by means of Huffman coding, an algorithm developed by David A. Huffman while he was a Sc.D. student at MIT, and published in the 1952 paper "A Method for the Construction of Minimum-Redundancy Codes",[1]" https://en.wikipedia.org/wiki/Huffman_coding Given an example of text "orange county community college" The transmitted bits would look like this: 01101111 01110010 01100001 01101110 01100111 01100101 00100000 01100011 01101111 01110101 01101110 01110100 01111001 00100000 01100011 01101111 01101101 01101101 01110101 01101110 01101001 01110100 01111001 00100000 01100011 01101111 01101100 01101100 01100101 01100111 01100101 However, we can encode it so that only the smallest amount of bits is needed to send the message. 011 10110 0100 1111 1001 001 1110 000 011 1101 1111 1000 1010 1110 000 011 1100 1100 1101 1111 10111 1000 1010 1110 000 011 0101 0101 001 1001 001 Steps needed to compress the data: 1) we need to find the frequency at each letter is occurring. Seq.no. 1 5 10 4 6 7 11 12 13 0 2 3 8 9 Chars 'a' K 'T' 'g' T ' 'm' 'u' 'y' 'c' 'e' 'n' 'o' ASCII 97 105 114 103 108 109 116 117 121 32 99 101 110 111 Frequency 1 1 1 2 2 2 2 2 2 3 3 3 3 4 Huffman 00100 00101 0011 0100 1100 0101 1101 1010 1011 000 1000 1001 011 111 ASCII 1100001 1101001 1110010 1100111 1101100 1101101 1110100 1110101 1111001 100000 1100011 1100101 1101110 1101111 2) sort the frequency as above from highest to lowest. This can be done using a priority queue or a min heap.

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

Essentials Of Services Marketing

Authors: Jochen Wirtz

4th Edition

1292425199, 9781292425191

More Books

Students also viewed these Algorithms questions