SlideShare a Scribd company logo
4
Most read
5
Most read
10
Most read
z
Algorithm
Presentation
Topic : Huffman Coding
z
Contents
 1.Definition
 2.Simulation
 3.Time Complexity
 4.Application
 5.Advantage/Disadvantage
z
Definition
 Huffman Coding is a lossless data compression
algorithm. The idea is to assign variable-length codes
to input characters, lengths of the assigned codes are
based on the frequencies of corresponding
characters.
 The most frequent character gets the smallest code
and the least frequent character gets the largest
code.
z Message- BCCABBDDAECCBBAEDDCC
Length-20
Letter ASCII
Code
Binary
Form
A 65 01000001
B 66 01000010
C 67 01000011
D 68 01000100
E 69 01000101
• For 1 Letter We need 8 bits
• For 20 Letters We need 8×20=160 bits
In Electric components the alphabet is
sent through ASCII code . The ASCII
code letter capital A is 65 and we need 8
bis binary to convert 65.
z
Simulation
A 3
B 5
C 6
D 4
E 2
E-2 A-3 D-4 B-5 C-6
5
Message : BCCABBDDAECCBBAEDDCC
First of all place the counts in
increasing order then take
minimum and add them now the
root node of letter E and A is 5
CountLetter
z
Simulation
A 3
B 5
C 6
D 4
E 2
E-2 A-3 D-4 B-5 C-6
5
9
Message : BCCABBDDAECCBBAEDDCC
Then between the root node 5
and counts take the minimum
and add them up . Here 5 and 4
are minimum so we add them
and make 9 as root node so
continue the process.
z
Simulation
A 3
B 5
C 6
D 4
E 2
E-2 A-3 D-4 B-5 C-6
5
9
11
20
Message : BCCABBDDAECCBBAEDDCC
z
Simulation
E-2 A-3 D-4 B-5 C-6
5
9
11
20
Message : BCCABBDDAECCBBAEDDCC
0
0
0 0
1
1
1
1
Mark the left hand edges as 0 and right
hand edges as 1 and then traverse from
root node to any letter . Suppose we
want to go A from root node so the
distance will be 001, for B 10 and so on.
z
Simulation
A
B
C
D
E
E-2 A-3 D-4 B-5 C-6
5
9
11
20
Message : BCCABBDDAECCBBAEDDCC
0
0
0 0
1
1
1
1
001
10
11
01
000
For A we need 3
bits ,B 2 bits , C 2
bits , D 2 bits, E 3
bits
For A,
Count =3
So total bits 3*3=9 bits
And so on
z
Simulation
A 3
B 5
C 6
D 4
E 2
E-2 A-3 D-4 B-5 C-6
5
9
11
20
Message : BCCABBDDAECCBBAEDDCC
0
0
0 0
1
1
1
1
001 3×3=9
10 5×2=10
11 6×2=12
01 4×2=8
000 2×3=6
Total=45 bits
As we see first we do need 160
bits and now we need 45 bits
now we have compressed the
cost and size.
z Time Complexity
 Time complexity of Huffman
Coding is O(nlogn) ,where n is
the number of unique
characters.
z Application
Generic File Compression:
 Files: GZIP, BZIP, 7Z
 Archives : 7z
 File System : NTFS,FS+,ZFS
Multimedia :
 Image : GIF, ZPEG
 Sound : Mp3
 Video : MPEG, HDTV
Communication :
 ITU-T T4 Group 3 Fax
 V.42 Bis modem
 Skype
Databases : Google,Facebook,…
z
Advantages/Disadvantages
Advantages :
The Huffman Coding has the minimum average length.
Easy to implement and fast.
Disadvantages :
Requires two passes over the two input (one to compute frequencies, one for
coding),thus encoding is slow.
Requires storing the Huffman codes(or at least character frequencies)in the
encoded file, thus reducing the compression benefit obtained by encoding.
z
Thank You

More Related Content

What's hot (20)

PPTX
Huffman codes
Nargis Ehsan
 
PPTX
Huffman Coding
Ehtisham Ali
 
PPTX
Bellman ford algorithm
MdSajjadulislamBappi
 
PPTX
Job sequencing with deadline
Arafat Hossan
 
PPTX
Data structure - Graph
Madhu Bala
 
PPTX
Asymptotic notations
Nikhil Sharma
 
PPT
01 knapsack using backtracking
mandlapure
 
PPT
Floyd Warshall Algorithm
InteX Research Lab
 
PPTX
simple problem to convert NFA with epsilon to without epsilon
kanikkk
 
PPT
Minimum spanning tree
Hinal Lunagariya
 
PPTX
Huffman coding || Huffman Tree
SatishKumarInumarthi
 
PPTX
Generating code from dags
indhu mathi
 
PPTX
convex hull
ravikirankalal
 
PPTX
daa-unit-3-greedy method
hodcsencet
 
PPTX
Data Representation
Dilum Bandara
 
PPT
Intermediate code generation (Compiler Design)
Tasif Tanzim
 
PDF
Symbol table in compiler Design
Kuppusamy P
 
PPTX
heap Sort Algorithm
Lemia Algmri
 
PPTX
Network Layer design Issues.pptx
Acad
 
PPT
Trees
Gaditek
 
Huffman codes
Nargis Ehsan
 
Huffman Coding
Ehtisham Ali
 
Bellman ford algorithm
MdSajjadulislamBappi
 
Job sequencing with deadline
Arafat Hossan
 
Data structure - Graph
Madhu Bala
 
Asymptotic notations
Nikhil Sharma
 
01 knapsack using backtracking
mandlapure
 
Floyd Warshall Algorithm
InteX Research Lab
 
simple problem to convert NFA with epsilon to without epsilon
kanikkk
 
Minimum spanning tree
Hinal Lunagariya
 
Huffman coding || Huffman Tree
SatishKumarInumarthi
 
Generating code from dags
indhu mathi
 
convex hull
ravikirankalal
 
daa-unit-3-greedy method
hodcsencet
 
Data Representation
Dilum Bandara
 
Intermediate code generation (Compiler Design)
Tasif Tanzim
 
Symbol table in compiler Design
Kuppusamy P
 
heap Sort Algorithm
Lemia Algmri
 
Network Layer design Issues.pptx
Acad
 
Trees
Gaditek
 

Similar to Huffman Coding Algorithm Presentation (20)

PPT
Huffman code presentation and their operation
HODCSE170941
 
PPTX
Chapter 5: Cominational Logic with MSI and LSI
Er. Nawaraj Bhandari
 
PPT
08 decoder
Aamina Aslam
 
PDF
cp467_12_lecture14_image compression1.pdf
shaikmoosa2003
 
PDF
FYBSC IT Digital Electronics Unit III Chapter I Combinational Logic Circuits
Arti Parab Academics
 
PPT
Compression ii
Chandra Mohan Negi
 
PPT
Combinational Logic Design for engineering and many more departments.ppt
chaitanyakumbhar008
 
PPTX
Chapter 4 Lossless Compression Algorithims.pptx
MedinaBedru
 
PPT
Digital Communication: Channel Coding
Dr. Sanjay M. Gulhane
 
PDF
Digital Electronics Questions and Answers
Jason J Pulikkottil
 
PDF
Online quesion deldunit-1-to_unit-4
shivnarayan34
 
PDF
Chapter-04.pdf
ssuserf7cd2b
 
PDF
Digital Principles and computer Organisation important 2 mark Questions
devadharshinip23cs
 
PDF
Objective Questions Digital Electronics
Nilesh Bhaskarrao Bahadure
 
PPTX
Unit 4 combinational circuit
Kalai Selvi
 
PPTX
Implementation of character translation integer and floating point values
غزالة
 
PPTX
lossless data compression and decompression using simple byte coding
Harshini Thota
 
PPT
combinational-circuit (1).ppt
ThanmayiKumar
 
PDF
A109210503 digitallogicdesign1
jntuworld
 
PPTX
Digital Communication Exam Help
Live Exam Helper
 
Huffman code presentation and their operation
HODCSE170941
 
Chapter 5: Cominational Logic with MSI and LSI
Er. Nawaraj Bhandari
 
08 decoder
Aamina Aslam
 
cp467_12_lecture14_image compression1.pdf
shaikmoosa2003
 
FYBSC IT Digital Electronics Unit III Chapter I Combinational Logic Circuits
Arti Parab Academics
 
Compression ii
Chandra Mohan Negi
 
Combinational Logic Design for engineering and many more departments.ppt
chaitanyakumbhar008
 
Chapter 4 Lossless Compression Algorithims.pptx
MedinaBedru
 
Digital Communication: Channel Coding
Dr. Sanjay M. Gulhane
 
Digital Electronics Questions and Answers
Jason J Pulikkottil
 
Online quesion deldunit-1-to_unit-4
shivnarayan34
 
Chapter-04.pdf
ssuserf7cd2b
 
Digital Principles and computer Organisation important 2 mark Questions
devadharshinip23cs
 
Objective Questions Digital Electronics
Nilesh Bhaskarrao Bahadure
 
Unit 4 combinational circuit
Kalai Selvi
 
Implementation of character translation integer and floating point values
غزالة
 
lossless data compression and decompression using simple byte coding
Harshini Thota
 
combinational-circuit (1).ppt
ThanmayiKumar
 
A109210503 digitallogicdesign1
jntuworld
 
Digital Communication Exam Help
Live Exam Helper
 
Ad

Recently uploaded (20)

PDF
AI TECHNIQUES FOR IDENTIFYING ALTERATIONS IN THE HUMAN GUT MICROBIOME IN MULT...
vidyalalltv1
 
PPT
New_school_Engineering_presentation_011707.ppt
VinayKumar304579
 
PDF
methodology-driven-mbse-murphy-july-hsv-huntsville6680038572db67488e78ff00003...
henriqueltorres1
 
PPTX
Biosensors, BioDevices, Biomediccal.pptx
AsimovRiyaz
 
PPTX
Distribution reservoir and service storage pptx
dhanashree78
 
PPTX
GitOps_Without_K8s_Training_detailed git repository
DanialHabibi2
 
PDF
methodology-driven-mbse-murphy-july-hsv-huntsville6680038572db67488e78ff00003...
henriqueltorres1
 
PDF
Reasons for the succes of MENARD PRESSUREMETER.pdf
majdiamz
 
PPTX
OCS353 DATA SCIENCE FUNDAMENTALS- Unit 1 Introduction to Data Science
A R SIVANESH M.E., (Ph.D)
 
PPTX
MODULE 03 - CLOUD COMPUTING AND SECURITY.pptx
Alvas Institute of Engineering and technology, Moodabidri
 
PDF
Viol_Alessandro_Presentazione_prelaurea.pdf
dsecqyvhbowrzxshhf
 
PDF
Halide Perovskites’ Multifunctional Properties: Coordination Engineering, Coo...
TaameBerhe2
 
PDF
Digital water marking system project report
Kamal Acharya
 
PDF
20ES1152 Programming for Problem Solving Lab Manual VRSEC.pdf
Ashutosh Satapathy
 
PPTX
Knowledge Representation : Semantic Networks
Amity University, Patna
 
PDF
WD2(I)-RFQ-GW-1415_ Shifting and Filling of Sand in the Pond at the WD5 Area_...
ShahadathHossain23
 
PPTX
MODULE 05 - CLOUD COMPUTING AND SECURITY.pptx
Alvas Institute of Engineering and technology, Moodabidri
 
PPTX
Introduction to Internal Combustion Engines - Types, Working and Camparison.pptx
UtkarshPatil98
 
PPTX
Numerical-Solutions-of-Ordinary-Differential-Equations.pptx
SAMUKTHAARM
 
PPTX
Water Resources Engineering (CVE 728)--Slide 4.pptx
mohammedado3
 
AI TECHNIQUES FOR IDENTIFYING ALTERATIONS IN THE HUMAN GUT MICROBIOME IN MULT...
vidyalalltv1
 
New_school_Engineering_presentation_011707.ppt
VinayKumar304579
 
methodology-driven-mbse-murphy-july-hsv-huntsville6680038572db67488e78ff00003...
henriqueltorres1
 
Biosensors, BioDevices, Biomediccal.pptx
AsimovRiyaz
 
Distribution reservoir and service storage pptx
dhanashree78
 
GitOps_Without_K8s_Training_detailed git repository
DanialHabibi2
 
methodology-driven-mbse-murphy-july-hsv-huntsville6680038572db67488e78ff00003...
henriqueltorres1
 
Reasons for the succes of MENARD PRESSUREMETER.pdf
majdiamz
 
OCS353 DATA SCIENCE FUNDAMENTALS- Unit 1 Introduction to Data Science
A R SIVANESH M.E., (Ph.D)
 
MODULE 03 - CLOUD COMPUTING AND SECURITY.pptx
Alvas Institute of Engineering and technology, Moodabidri
 
Viol_Alessandro_Presentazione_prelaurea.pdf
dsecqyvhbowrzxshhf
 
Halide Perovskites’ Multifunctional Properties: Coordination Engineering, Coo...
TaameBerhe2
 
Digital water marking system project report
Kamal Acharya
 
20ES1152 Programming for Problem Solving Lab Manual VRSEC.pdf
Ashutosh Satapathy
 
Knowledge Representation : Semantic Networks
Amity University, Patna
 
WD2(I)-RFQ-GW-1415_ Shifting and Filling of Sand in the Pond at the WD5 Area_...
ShahadathHossain23
 
MODULE 05 - CLOUD COMPUTING AND SECURITY.pptx
Alvas Institute of Engineering and technology, Moodabidri
 
Introduction to Internal Combustion Engines - Types, Working and Camparison.pptx
UtkarshPatil98
 
Numerical-Solutions-of-Ordinary-Differential-Equations.pptx
SAMUKTHAARM
 
Water Resources Engineering (CVE 728)--Slide 4.pptx
mohammedado3
 
Ad

Huffman Coding Algorithm Presentation

  • 2. z Contents  1.Definition  2.Simulation  3.Time Complexity  4.Application  5.Advantage/Disadvantage
  • 3. z Definition  Huffman Coding is a lossless data compression algorithm. The idea is to assign variable-length codes to input characters, lengths of the assigned codes are based on the frequencies of corresponding characters.  The most frequent character gets the smallest code and the least frequent character gets the largest code.
  • 4. z Message- BCCABBDDAECCBBAEDDCC Length-20 Letter ASCII Code Binary Form A 65 01000001 B 66 01000010 C 67 01000011 D 68 01000100 E 69 01000101 • For 1 Letter We need 8 bits • For 20 Letters We need 8×20=160 bits In Electric components the alphabet is sent through ASCII code . The ASCII code letter capital A is 65 and we need 8 bis binary to convert 65.
  • 5. z Simulation A 3 B 5 C 6 D 4 E 2 E-2 A-3 D-4 B-5 C-6 5 Message : BCCABBDDAECCBBAEDDCC First of all place the counts in increasing order then take minimum and add them now the root node of letter E and A is 5 CountLetter
  • 6. z Simulation A 3 B 5 C 6 D 4 E 2 E-2 A-3 D-4 B-5 C-6 5 9 Message : BCCABBDDAECCBBAEDDCC Then between the root node 5 and counts take the minimum and add them up . Here 5 and 4 are minimum so we add them and make 9 as root node so continue the process.
  • 7. z Simulation A 3 B 5 C 6 D 4 E 2 E-2 A-3 D-4 B-5 C-6 5 9 11 20 Message : BCCABBDDAECCBBAEDDCC
  • 8. z Simulation E-2 A-3 D-4 B-5 C-6 5 9 11 20 Message : BCCABBDDAECCBBAEDDCC 0 0 0 0 1 1 1 1 Mark the left hand edges as 0 and right hand edges as 1 and then traverse from root node to any letter . Suppose we want to go A from root node so the distance will be 001, for B 10 and so on.
  • 9. z Simulation A B C D E E-2 A-3 D-4 B-5 C-6 5 9 11 20 Message : BCCABBDDAECCBBAEDDCC 0 0 0 0 1 1 1 1 001 10 11 01 000 For A we need 3 bits ,B 2 bits , C 2 bits , D 2 bits, E 3 bits For A, Count =3 So total bits 3*3=9 bits And so on
  • 10. z Simulation A 3 B 5 C 6 D 4 E 2 E-2 A-3 D-4 B-5 C-6 5 9 11 20 Message : BCCABBDDAECCBBAEDDCC 0 0 0 0 1 1 1 1 001 3×3=9 10 5×2=10 11 6×2=12 01 4×2=8 000 2×3=6 Total=45 bits As we see first we do need 160 bits and now we need 45 bits now we have compressed the cost and size.
  • 11. z Time Complexity  Time complexity of Huffman Coding is O(nlogn) ,where n is the number of unique characters.
  • 12. z Application Generic File Compression:  Files: GZIP, BZIP, 7Z  Archives : 7z  File System : NTFS,FS+,ZFS Multimedia :  Image : GIF, ZPEG  Sound : Mp3  Video : MPEG, HDTV Communication :  ITU-T T4 Group 3 Fax  V.42 Bis modem  Skype Databases : Google,Facebook,…
  • 13. z Advantages/Disadvantages Advantages : The Huffman Coding has the minimum average length. Easy to implement and fast. Disadvantages : Requires two passes over the two input (one to compute frequencies, one for coding),thus encoding is slow. Requires storing the Huffman codes(or at least character frequencies)in the encoded file, thus reducing the compression benefit obtained by encoding.