SlideShare a Scribd company logo
1 of 14
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

3. The Data Encryption Standard (DES) and Alternatives
3. The Data Encryption Standard (DES) and Alternatives3. The Data Encryption Standard (DES) and Alternatives
3. The Data Encryption Standard (DES) and AlternativesSam Bowne
 
Performance analysis(Time & Space Complexity)
Performance analysis(Time & Space Complexity)Performance analysis(Time & Space Complexity)
Performance analysis(Time & Space Complexity)swapnac12
 
Matrix chain multiplication
Matrix chain multiplicationMatrix chain multiplication
Matrix chain multiplicationRespa Peter
 
Data Encryption Standard (DES)
Data Encryption Standard (DES)Data Encryption Standard (DES)
Data Encryption Standard (DES)Haris Ahmed
 
carry look ahead adder
carry look ahead addercarry look ahead adder
carry look ahead adderASHISH MANI
 
Code optimization in compiler design
Code optimization in compiler designCode optimization in compiler design
Code optimization in compiler designKuppusamy P
 
Three address code In Compiler Design
Three address code In Compiler DesignThree address code In Compiler Design
Three address code In Compiler DesignShine Raj
 
Syntax directed translation
Syntax directed translationSyntax directed translation
Syntax directed translationAkshaya Arunan
 
Huffman Algorithm and its Application by Ekansh Agarwal
Huffman Algorithm and its Application by Ekansh AgarwalHuffman Algorithm and its Application by Ekansh Agarwal
Huffman Algorithm and its Application by Ekansh AgarwalEkansh Agarwal
 
Three Address code
Three Address code Three Address code
Three Address code Pooja Dixit
 
A presentation on prim's and kruskal's algorithm
A presentation on prim's and kruskal's algorithmA presentation on prim's and kruskal's algorithm
A presentation on prim's and kruskal's algorithmGaurav Kolekar
 
Modern Block Cipher- Modern Symmetric-Key Cipher
Modern Block Cipher- Modern Symmetric-Key CipherModern Block Cipher- Modern Symmetric-Key Cipher
Modern Block Cipher- Modern Symmetric-Key CipherMahbubur Rahman
 
SHA- Secure hashing algorithm
SHA- Secure hashing algorithmSHA- Secure hashing algorithm
SHA- Secure hashing algorithmRuchi Maurya
 

What's hot (20)

Huffman Coding
Huffman CodingHuffman Coding
Huffman Coding
 
Bfs and Dfs
Bfs and DfsBfs and Dfs
Bfs and Dfs
 
Huffman Coding
Huffman CodingHuffman Coding
Huffman Coding
 
3. The Data Encryption Standard (DES) and Alternatives
3. The Data Encryption Standard (DES) and Alternatives3. The Data Encryption Standard (DES) and Alternatives
3. The Data Encryption Standard (DES) and Alternatives
 
Performance analysis(Time & Space Complexity)
Performance analysis(Time & Space Complexity)Performance analysis(Time & Space Complexity)
Performance analysis(Time & Space Complexity)
 
Matrix chain multiplication
Matrix chain multiplicationMatrix chain multiplication
Matrix chain multiplication
 
Secure Hash Algorithm
Secure Hash AlgorithmSecure Hash Algorithm
Secure Hash Algorithm
 
Data Encryption Standard (DES)
Data Encryption Standard (DES)Data Encryption Standard (DES)
Data Encryption Standard (DES)
 
Distance vector routing
Distance vector routingDistance vector routing
Distance vector routing
 
carry look ahead adder
carry look ahead addercarry look ahead adder
carry look ahead adder
 
Code optimization in compiler design
Code optimization in compiler designCode optimization in compiler design
Code optimization in compiler design
 
Three address code In Compiler Design
Three address code In Compiler DesignThree address code In Compiler Design
Three address code In Compiler Design
 
Pda
PdaPda
Pda
 
Syntax directed translation
Syntax directed translationSyntax directed translation
Syntax directed translation
 
Huffman Algorithm and its Application by Ekansh Agarwal
Huffman Algorithm and its Application by Ekansh AgarwalHuffman Algorithm and its Application by Ekansh Agarwal
Huffman Algorithm and its Application by Ekansh Agarwal
 
Three Address code
Three Address code Three Address code
Three Address code
 
A presentation on prim's and kruskal's algorithm
A presentation on prim's and kruskal's algorithmA presentation on prim's and kruskal's algorithm
A presentation on prim's and kruskal's algorithm
 
Modern Block Cipher- Modern Symmetric-Key Cipher
Modern Block Cipher- Modern Symmetric-Key CipherModern Block Cipher- Modern Symmetric-Key Cipher
Modern Block Cipher- Modern Symmetric-Key Cipher
 
SHA- Secure hashing algorithm
SHA- Secure hashing algorithmSHA- Secure hashing algorithm
SHA- Secure hashing algorithm
 
push down automata
push down automatapush down automata
push down automata
 

Similar to Huffman Coding Algorithm Presentation

Chapter 5: Cominational Logic with MSI and LSI
Chapter 5: Cominational Logic with MSI and LSIChapter 5: Cominational Logic with MSI and LSI
Chapter 5: Cominational Logic with MSI and LSIEr. Nawaraj Bhandari
 
cp467_12_lecture14_image compression1.pdf
cp467_12_lecture14_image compression1.pdfcp467_12_lecture14_image compression1.pdf
cp467_12_lecture14_image compression1.pdfshaikmoosa2003
 
FYBSC IT Digital Electronics Unit III Chapter I Combinational Logic Circuits
FYBSC IT Digital Electronics Unit III Chapter I Combinational Logic CircuitsFYBSC IT Digital Electronics Unit III Chapter I Combinational Logic Circuits
FYBSC IT Digital Electronics Unit III Chapter I Combinational Logic CircuitsArti Parab Academics
 
Chapter 4 Lossless Compression Algorithims.pptx
Chapter 4 Lossless Compression Algorithims.pptxChapter 4 Lossless Compression Algorithims.pptx
Chapter 4 Lossless Compression Algorithims.pptxMedinaBedru
 
Digital Communication: Channel Coding
Digital Communication: Channel CodingDigital Communication: Channel Coding
Digital Communication: Channel CodingDr. Sanjay M. Gulhane
 
Online quesion deldunit-1-to_unit-4
Online quesion deldunit-1-to_unit-4Online quesion deldunit-1-to_unit-4
Online quesion deldunit-1-to_unit-4shivnarayan34
 
Unit 4 combinational circuit
Unit 4 combinational circuitUnit 4 combinational circuit
Unit 4 combinational circuitKalai Selvi
 
Implementation of character translation integer and floating point values
Implementation of character translation integer and floating point valuesImplementation of character translation integer and floating point values
Implementation of character translation integer and floating point valuesغزالة
 
lossless data compression and decompression using simple byte coding
lossless data compression and decompression using simple byte codinglossless data compression and decompression using simple byte coding
lossless data compression and decompression using simple byte codingHarshini Thota
 
combinational-circuit (1).ppt
combinational-circuit (1).pptcombinational-circuit (1).ppt
combinational-circuit (1).pptThanmayiKumar
 
A109210503 digitallogicdesign1
A109210503 digitallogicdesign1A109210503 digitallogicdesign1
A109210503 digitallogicdesign1jntuworld
 
Digital Communication Exam Help
Digital Communication Exam HelpDigital Communication Exam Help
Digital Communication Exam HelpLive Exam Helper
 
Ec2203 digital electronics questions anna university by www.annaunivedu.org
Ec2203 digital electronics questions anna university by www.annaunivedu.orgEc2203 digital electronics questions anna university by www.annaunivedu.org
Ec2203 digital electronics questions anna university by www.annaunivedu.organnaunivedu
 
I semester Unit 4 combinational circuits.pptx
I semester Unit 4 combinational circuits.pptxI semester Unit 4 combinational circuits.pptx
I semester Unit 4 combinational circuits.pptxMayank Pandey
 

Similar to Huffman Coding Algorithm Presentation (20)

Chapter 5: Cominational Logic with MSI and LSI
Chapter 5: Cominational Logic with MSI and LSIChapter 5: Cominational Logic with MSI and LSI
Chapter 5: Cominational Logic with MSI and LSI
 
08 decoder
08 decoder08 decoder
08 decoder
 
cp467_12_lecture14_image compression1.pdf
cp467_12_lecture14_image compression1.pdfcp467_12_lecture14_image compression1.pdf
cp467_12_lecture14_image compression1.pdf
 
FYBSC IT Digital Electronics Unit III Chapter I Combinational Logic Circuits
FYBSC IT Digital Electronics Unit III Chapter I Combinational Logic CircuitsFYBSC IT Digital Electronics Unit III Chapter I Combinational Logic Circuits
FYBSC IT Digital Electronics Unit III Chapter I Combinational Logic Circuits
 
Compression ii
Compression iiCompression ii
Compression ii
 
Chapter 4 Lossless Compression Algorithims.pptx
Chapter 4 Lossless Compression Algorithims.pptxChapter 4 Lossless Compression Algorithims.pptx
Chapter 4 Lossless Compression Algorithims.pptx
 
Digital Communication: Channel Coding
Digital Communication: Channel CodingDigital Communication: Channel Coding
Digital Communication: Channel Coding
 
Online quesion deldunit-1-to_unit-4
Online quesion deldunit-1-to_unit-4Online quesion deldunit-1-to_unit-4
Online quesion deldunit-1-to_unit-4
 
Chapter-04.pdf
Chapter-04.pdfChapter-04.pdf
Chapter-04.pdf
 
Objective Questions Digital Electronics
Objective Questions Digital ElectronicsObjective Questions Digital Electronics
Objective Questions Digital Electronics
 
Unit 4 combinational circuit
Unit 4 combinational circuitUnit 4 combinational circuit
Unit 4 combinational circuit
 
Implementation of character translation integer and floating point values
Implementation of character translation integer and floating point valuesImplementation of character translation integer and floating point values
Implementation of character translation integer and floating point values
 
lossless data compression and decompression using simple byte coding
lossless data compression and decompression using simple byte codinglossless data compression and decompression using simple byte coding
lossless data compression and decompression using simple byte coding
 
combinational-circuit (1).ppt
combinational-circuit (1).pptcombinational-circuit (1).ppt
combinational-circuit (1).ppt
 
A109210503 digitallogicdesign1
A109210503 digitallogicdesign1A109210503 digitallogicdesign1
A109210503 digitallogicdesign1
 
Digital Communication Exam Help
Digital Communication Exam HelpDigital Communication Exam Help
Digital Communication Exam Help
 
Ec2203 digital electronics questions anna university by www.annaunivedu.org
Ec2203 digital electronics questions anna university by www.annaunivedu.orgEc2203 digital electronics questions anna university by www.annaunivedu.org
Ec2203 digital electronics questions anna university by www.annaunivedu.org
 
I semester Unit 4 combinational circuits.pptx
I semester Unit 4 combinational circuits.pptxI semester Unit 4 combinational circuits.pptx
I semester Unit 4 combinational circuits.pptx
 
. computer codes
. computer codes. computer codes
. computer codes
 
BCDCONVERTER.pptx
BCDCONVERTER.pptxBCDCONVERTER.pptx
BCDCONVERTER.pptx
 

Recently uploaded

Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingrakeshbaidya232001
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSKurinjimalarL3
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130Suhani Kapoor
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxpurnimasatapathy1234
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 
chaitra-1.pptx fake news detection using machine learning
chaitra-1.pptx  fake news detection using machine learningchaitra-1.pptx  fake news detection using machine learning
chaitra-1.pptx fake news detection using machine learningmisbanausheenparvam
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVRajaP95
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxupamatechverse
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )Tsuyoshi Horigome
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024hassan khalil
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escortsranjana rawat
 
main PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidmain PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidNikhilNagaraju
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSSIVASHANKAR N
 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...Soham Mondal
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINESIVASHANKAR N
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Dr.Costas Sachpazis
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxupamatechverse
 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxAsutosh Ranjan
 

Recently uploaded (20)

Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writing
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptx
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
 
chaitra-1.pptx fake news detection using machine learning
chaitra-1.pptx  fake news detection using machine learningchaitra-1.pptx  fake news detection using machine learning
chaitra-1.pptx fake news detection using machine learning
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptx
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
 
main PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidmain PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfid
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptx
 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptx
 

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.