Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Huffman Coding: Design, Analysis, and Implementation, Lecture notes of Design and Analysis of Algorithms

An in-depth exploration of huffman coding, a popular data compression technique that utilizes a greedy strategy to produce optimal prefix codes based on character frequencies. The scope, advantages, and disadvantages of fixed and variable length coding, the concept of prefix codes, and the construction of a huffman tree. It also includes a pseudocode for the huffman coding algorithm and an exercise to draw the huffman tree and generate huffman codes for a given set of characters.

Typology: Lecture notes

2023/2024

Uploaded on 02/22/2024

drunkbastard
drunkbastard 🇮🇳

1 document

1 / 11

Toggle sidebar

Related documents


Partial preview of the text

Download Huffman Coding: Design, Analysis, and Implementation and more Lecture notes Design and Analysis of Algorithms in PDF only on Docsity! BCSE204L Design and Analysis of Algorithms Module-1 Huffman Coding (Greedy Technique) Dr Athira K SCOPE Data Compression Requirements •Storage and communication •Huffman codes compress data very effectively: savings of 20% to 90% are typical •Greedy on the frequency of each character in the data •Huffman coding is used widely as the basic building block of numerous other compression algorithms •Fixed length and variable length coding Prefix Codes Example •Encoding:- 𝑎𝑏𝑐→ 0 · 101 · 100 where · is concatenation •Therefore, instead of 𝑎𝑏𝑐 we send 0101100 •Decoded at the receiving end without ambiguity, provided the receiver must know the coding table Huffman Coding •Produces optimal prefix codes based on the frequency of occurrence of characters within the message/data • Follows greedy strategy •Assume that 𝐶 is a set of 𝑛 characters and that each • character 𝑐 ∈ 𝐶 is an object with an attribute 𝑐. 𝑓𝑟𝑒𝑞 giving its frequency Huffman Tree •Algorithm builds Huffman tree, 𝑇 in a bottom up manner • Initially a set of |𝐶| leaves and performs |𝐶| − 1 merge operations •Uses a min-priority queue 𝑄, keyed on the 𝑓𝑟𝑒𝑞 attribute Exercise •Draw the Huffman tree and generate the Huffman code •Answer: a=111, e=10, i=00, o=11001, u=1101, s=01, t=11000 a e i o u s t 10 15 12 3 4 13 1 Thank you..
Docsity logo



Copyright © 2024 Ladybird Srl - Via Leonardo da Vinci 16, 10126, Torino, Italy - VAT 10816460017 - All rights reserved