SlideShare a Scribd company logo
1 of 8
Huffman Coding
      Presented By:




   Ehtisham Ali
Objectives


What are Huffman Codes ?

Why Huffman Codes are used ?
Introduction

An effective and widely used Application of
Binary Trees and Priority Queues

Developed by David.A.Huffman while he was a Ph.d student at MIT and
published in the 1952 paper “A Method for the Construction of Minimum
Redundancy Codes”.

Each code is a binary string that is used for transmission of the
corresponding message.

For Example :

        BAGGAGE                           100 11 0 0 11 0 101
         Plain Text                             Huffman Code
Major Steps
                                                           baggage
1.   Prepare the frequency table.
2.   Construct the binary tree.                    Alphabets   Frequencies
3.   Extract the Huffman Code from the tree.           b             1
                                                       a             2
                                                       g             3
         Binary Tree                                   e             1

                                                   This Huffman Code is
                                                     now used for the
                                                   transmission of word
                                                        “baggage”.


         Huffman Code     100 11 0 0 11 0 101
                            b   a g g a g      e
Algorithm

n <- |C|
Q <- C
for i <- 1 to n-1
       do allocate a new node z
             left [ z ] <- x <- EXTRACT-MIN (Q)
             right [ z ] <- y <- EXTRACT-MIN (Q)
             f [ z ] <- f [ x ] + f [ y ]
             INSERT(Q, Z)
return EXTRACT-MIN (Q)
Analysis

Time Complexity:

         Time complexity of Huffman algorithm is O(nlogn) where each
iteration requires O(logn) time to determine the cheapest weight and there
would be O(n) iterations.
Applications Of Huffman Coding

Supports various file type as:

        ZIP (multichannel compression including text and other data types)
        JPEG
        MPEG (only upto 2 layers)

Also used in steganography for JPEG carrier compression.
Conclusion

Like many other useful algorithms we do require Huffman Algorithm for
compression of data so it could be transmitted over internet and other
transmission channels properly.

Huffman algorithm works on Binary trees.




                                 Huffman
        DATA                                         Huffman Code
                                 Algorithm

More Related Content

What's hot

Huffman's Alforithm
Huffman's AlforithmHuffman's Alforithm
Huffman's AlforithmRoohaali
 
Multidimensional array in C
Multidimensional array in CMultidimensional array in C
Multidimensional array in CSmit Parikh
 
Computer Networks - Error Detection & Error Correction
Computer Networks - Error Detection & Error CorrectionComputer Networks - Error Detection & Error Correction
Computer Networks - Error Detection & Error CorrectionSaikrishna Tanguturu
 
Huffman Tree And Its Application
Huffman Tree And Its ApplicationHuffman Tree And Its Application
Huffman Tree And Its ApplicationPapu Kumar
 
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
 
0 1 knapsack using branch and bound
0 1 knapsack using branch and bound0 1 knapsack using branch and bound
0 1 knapsack using branch and boundAbhishek Singh
 
Error Control Coding -Introduction
Error Control Coding -IntroductionError Control Coding -Introduction
Error Control Coding -IntroductionBurdwan University
 
Proof of Kraft-McMillan theorem
Proof of Kraft-McMillan theoremProof of Kraft-McMillan theorem
Proof of Kraft-McMillan theoremVu Hung Nguyen
 
Error Detection and Correction - Data link Layer
Error Detection and Correction - Data link LayerError Detection and Correction - Data link Layer
Error Detection and Correction - Data link LayerAbdullaziz Tagawy
 
Two dimensional array
Two dimensional arrayTwo dimensional array
Two dimensional arrayRajendran
 
Manchester & Differential Manchester encoding scheme
Manchester & Differential Manchester encoding schemeManchester & Differential Manchester encoding scheme
Manchester & Differential Manchester encoding schemeArunabha Saha
 

What's hot (20)

Huffman tree
Huffman tree Huffman tree
Huffman tree
 
Huffman's Alforithm
Huffman's AlforithmHuffman's Alforithm
Huffman's Alforithm
 
Multidimensional array in C
Multidimensional array in CMultidimensional array in C
Multidimensional array in C
 
Computer Networks - Error Detection & Error Correction
Computer Networks - Error Detection & Error CorrectionComputer Networks - Error Detection & Error Correction
Computer Networks - Error Detection & Error Correction
 
Huffman Tree And Its Application
Huffman Tree And Its ApplicationHuffman Tree And Its Application
Huffman Tree And Its Application
 
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
 
Channel coding
Channel coding  Channel coding
Channel coding
 
0 1 knapsack using branch and bound
0 1 knapsack using branch and bound0 1 knapsack using branch and bound
0 1 knapsack using branch and bound
 
Error Control Coding -Introduction
Error Control Coding -IntroductionError Control Coding -Introduction
Error Control Coding -Introduction
 
Ripple Carry Adder
Ripple Carry AdderRipple Carry Adder
Ripple Carry Adder
 
BCH Codes
BCH CodesBCH Codes
BCH Codes
 
linear codes and cyclic codes
linear codes and cyclic codeslinear codes and cyclic codes
linear codes and cyclic codes
 
8086 memory segmentation
8086 memory segmentation8086 memory segmentation
8086 memory segmentation
 
Proof of Kraft-McMillan theorem
Proof of Kraft-McMillan theoremProof of Kraft-McMillan theorem
Proof of Kraft-McMillan theorem
 
Error Detection and Correction - Data link Layer
Error Detection and Correction - Data link LayerError Detection and Correction - Data link Layer
Error Detection and Correction - Data link Layer
 
Two dimensional array
Two dimensional arrayTwo dimensional array
Two dimensional array
 
Data and signals
Data and signalsData and signals
Data and signals
 
DPCM
DPCMDPCM
DPCM
 
Issues in Data Link Layer
Issues in Data Link LayerIssues in Data Link Layer
Issues in Data Link Layer
 
Manchester & Differential Manchester encoding scheme
Manchester & Differential Manchester encoding schemeManchester & Differential Manchester encoding scheme
Manchester & Differential Manchester encoding scheme
 

Viewers also liked

Viewers also liked (7)

Lzw compression
Lzw compressionLzw compression
Lzw compression
 
DCT
DCTDCT
DCT
 
2 d geometric transformations
2 d geometric transformations2 d geometric transformations
2 d geometric transformations
 
Huffman Coding
Huffman CodingHuffman Coding
Huffman Coding
 
Writing algorithms
Writing algorithmsWriting algorithms
Writing algorithms
 
Discrete cosine transform
Discrete cosine transformDiscrete cosine transform
Discrete cosine transform
 
Image processing fundamentals
Image processing fundamentalsImage processing fundamentals
Image processing fundamentals
 

Similar to Huffman Coding Explained

16_Greedy_Algorithms.ppt
16_Greedy_Algorithms.ppt16_Greedy_Algorithms.ppt
16_Greedy_Algorithms.pptDrAliKMattar
 
16_Greedy_Algorithms Greedy_AlgorithmsGreedy_Algorithms
16_Greedy_Algorithms Greedy_AlgorithmsGreedy_Algorithms16_Greedy_Algorithms Greedy_AlgorithmsGreedy_Algorithms
16_Greedy_Algorithms Greedy_AlgorithmsGreedy_AlgorithmsShanmuganathan C
 
Huffman coding
Huffman codingHuffman coding
Huffman codingGeorge Ang
 
DSA Presentetion Huffman tree.pdf
DSA Presentetion Huffman tree.pdfDSA Presentetion Huffman tree.pdf
DSA Presentetion Huffman tree.pdfGaneshPawar819187
 
j001adcpresentation-2112170415 23.pdf
j001adcpresentation-2112170415      23.pdfj001adcpresentation-2112170415      23.pdf
j001adcpresentation-2112170415 23.pdfHarshSharma71048
 
Erlang Message Passing Concurrency, For The Win
Erlang  Message  Passing  Concurrency,  For  The  WinErlang  Message  Passing  Concurrency,  For  The  Win
Erlang Message Passing Concurrency, For The Winl xf
 
Reversible Digital Watermarking of Audio Wav Signal Using Additive Interpolat...
Reversible Digital Watermarking of Audio Wav Signal Using Additive Interpolat...Reversible Digital Watermarking of Audio Wav Signal Using Additive Interpolat...
Reversible Digital Watermarking of Audio Wav Signal Using Additive Interpolat...ijsrd.com
 

Similar to Huffman Coding Explained (14)

Huffman ppt
Huffman ppt Huffman ppt
Huffman ppt
 
Huffman
HuffmanHuffman
Huffman
 
Huffman
HuffmanHuffman
Huffman
 
16_Greedy_Algorithms.ppt
16_Greedy_Algorithms.ppt16_Greedy_Algorithms.ppt
16_Greedy_Algorithms.ppt
 
16_Greedy_Algorithms Greedy_AlgorithmsGreedy_Algorithms
16_Greedy_Algorithms Greedy_AlgorithmsGreedy_Algorithms16_Greedy_Algorithms Greedy_AlgorithmsGreedy_Algorithms
16_Greedy_Algorithms Greedy_AlgorithmsGreedy_Algorithms
 
16_Greedy_Algorithms.ppt
16_Greedy_Algorithms.ppt16_Greedy_Algorithms.ppt
16_Greedy_Algorithms.ppt
 
Text compression
Text compressionText compression
Text compression
 
Huffman coding
Huffman codingHuffman coding
Huffman coding
 
DSA Presentetion Huffman tree.pdf
DSA Presentetion Huffman tree.pdfDSA Presentetion Huffman tree.pdf
DSA Presentetion Huffman tree.pdf
 
j001adcpresentation-2112170415 23.pdf
j001adcpresentation-2112170415      23.pdfj001adcpresentation-2112170415      23.pdf
j001adcpresentation-2112170415 23.pdf
 
Lec5 Compression
Lec5 CompressionLec5 Compression
Lec5 Compression
 
Erlang Message Passing Concurrency, For The Win
Erlang  Message  Passing  Concurrency,  For  The  WinErlang  Message  Passing  Concurrency,  For  The  Win
Erlang Message Passing Concurrency, For The Win
 
Lec32
Lec32Lec32
Lec32
 
Reversible Digital Watermarking of Audio Wav Signal Using Additive Interpolat...
Reversible Digital Watermarking of Audio Wav Signal Using Additive Interpolat...Reversible Digital Watermarking of Audio Wav Signal Using Additive Interpolat...
Reversible Digital Watermarking of Audio Wav Signal Using Additive Interpolat...
 

More from Ehtisham Ali

More from Ehtisham Ali (20)

Vintage indian advertisement's
Vintage indian advertisement'sVintage indian advertisement's
Vintage indian advertisement's
 
Extreme Interview Questions
Extreme Interview QuestionsExtreme Interview Questions
Extreme Interview Questions
 
Windows Avtars
Windows AvtarsWindows Avtars
Windows Avtars
 
Intruders detection
Intruders detectionIntruders detection
Intruders detection
 
Digital Signatures
Digital SignaturesDigital Signatures
Digital Signatures
 
Asymptotic notations
Asymptotic notationsAsymptotic notations
Asymptotic notations
 
Windows basic quiz
Windows basic quizWindows basic quiz
Windows basic quiz
 
Wallpapers show
Wallpapers showWallpapers show
Wallpapers show
 
Wi fi Technology
Wi fi TechnologyWi fi Technology
Wi fi Technology
 
Virtual vista
Virtual vistaVirtual vista
Virtual vista
 
Marketing segmentations
Marketing segmentationsMarketing segmentations
Marketing segmentations
 
Lcd technology
Lcd technologyLcd technology
Lcd technology
 
Gd topics list
Gd topics listGd topics list
Gd topics list
 
Dvd
DvdDvd
Dvd
 
My room
My roomMy room
My room
 
Filmi kids
Filmi kidsFilmi kids
Filmi kids
 
Excel tutorial on students record
Excel tutorial on students record Excel tutorial on students record
Excel tutorial on students record
 
Television broadcasting and promotion
Television broadcasting and promotionTelevision broadcasting and promotion
Television broadcasting and promotion
 
TechQuiz
TechQuizTechQuiz
TechQuiz
 
Ms dos tutorial
Ms dos tutorialMs dos tutorial
Ms dos tutorial
 

Recently uploaded

Man or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptx
Man or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptxMan or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptx
Man or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptxDhatriParmar
 
Scientific Writing :Research Discourse
Scientific  Writing :Research  DiscourseScientific  Writing :Research  Discourse
Scientific Writing :Research DiscourseAnita GoswamiGiri
 
Mental Health Awareness - a toolkit for supporting young minds
Mental Health Awareness - a toolkit for supporting young mindsMental Health Awareness - a toolkit for supporting young minds
Mental Health Awareness - a toolkit for supporting young mindsPooky Knightsmith
 
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...Nguyen Thanh Tu Collection
 
Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...
Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...
Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...DhatriParmar
 
Q-Factor General Quiz-7th April 2024, Quiz Club NITW
Q-Factor General Quiz-7th April 2024, Quiz Club NITWQ-Factor General Quiz-7th April 2024, Quiz Club NITW
Q-Factor General Quiz-7th April 2024, Quiz Club NITWQuiz Club NITW
 
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxINTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxHumphrey A Beña
 
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptxQ4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptxlancelewisportillo
 
Multi Domain Alias In the Odoo 17 ERP Module
Multi Domain Alias In the Odoo 17 ERP ModuleMulti Domain Alias In the Odoo 17 ERP Module
Multi Domain Alias In the Odoo 17 ERP ModuleCeline George
 
4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptx4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptxmary850239
 
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfGrade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfJemuel Francisco
 
Mythology Quiz-4th April 2024, Quiz Club NITW
Mythology Quiz-4th April 2024, Quiz Club NITWMythology Quiz-4th April 2024, Quiz Club NITW
Mythology Quiz-4th April 2024, Quiz Club NITWQuiz Club NITW
 
Congestive Cardiac Failure..presentation
Congestive Cardiac Failure..presentationCongestive Cardiac Failure..presentation
Congestive Cardiac Failure..presentationdeepaannamalai16
 
Grade Three -ELLNA-REVIEWER-ENGLISH.pptx
Grade Three -ELLNA-REVIEWER-ENGLISH.pptxGrade Three -ELLNA-REVIEWER-ENGLISH.pptx
Grade Three -ELLNA-REVIEWER-ENGLISH.pptxkarenfajardo43
 
ClimART Action | eTwinning Project
ClimART Action    |    eTwinning ProjectClimART Action    |    eTwinning Project
ClimART Action | eTwinning Projectjordimapav
 
Unraveling Hypertext_ Analyzing Postmodern Elements in Literature.pptx
Unraveling Hypertext_ Analyzing  Postmodern Elements in  Literature.pptxUnraveling Hypertext_ Analyzing  Postmodern Elements in  Literature.pptx
Unraveling Hypertext_ Analyzing Postmodern Elements in Literature.pptxDhatriParmar
 
Active Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdfActive Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdfPatidar M
 
Transaction Management in Database Management System
Transaction Management in Database Management SystemTransaction Management in Database Management System
Transaction Management in Database Management SystemChristalin Nelson
 
DIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptx
DIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptxDIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptx
DIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptxMichelleTuguinay1
 

Recently uploaded (20)

Man or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptx
Man or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptxMan or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptx
Man or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptx
 
Scientific Writing :Research Discourse
Scientific  Writing :Research  DiscourseScientific  Writing :Research  Discourse
Scientific Writing :Research Discourse
 
Mental Health Awareness - a toolkit for supporting young minds
Mental Health Awareness - a toolkit for supporting young mindsMental Health Awareness - a toolkit for supporting young minds
Mental Health Awareness - a toolkit for supporting young minds
 
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...
 
Faculty Profile prashantha K EEE dept Sri Sairam college of Engineering
Faculty Profile prashantha K EEE dept Sri Sairam college of EngineeringFaculty Profile prashantha K EEE dept Sri Sairam college of Engineering
Faculty Profile prashantha K EEE dept Sri Sairam college of Engineering
 
Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...
Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...
Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...
 
Q-Factor General Quiz-7th April 2024, Quiz Club NITW
Q-Factor General Quiz-7th April 2024, Quiz Club NITWQ-Factor General Quiz-7th April 2024, Quiz Club NITW
Q-Factor General Quiz-7th April 2024, Quiz Club NITW
 
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxINTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
 
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptxQ4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
 
Multi Domain Alias In the Odoo 17 ERP Module
Multi Domain Alias In the Odoo 17 ERP ModuleMulti Domain Alias In the Odoo 17 ERP Module
Multi Domain Alias In the Odoo 17 ERP Module
 
4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptx4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptx
 
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfGrade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
 
Mythology Quiz-4th April 2024, Quiz Club NITW
Mythology Quiz-4th April 2024, Quiz Club NITWMythology Quiz-4th April 2024, Quiz Club NITW
Mythology Quiz-4th April 2024, Quiz Club NITW
 
Congestive Cardiac Failure..presentation
Congestive Cardiac Failure..presentationCongestive Cardiac Failure..presentation
Congestive Cardiac Failure..presentation
 
Grade Three -ELLNA-REVIEWER-ENGLISH.pptx
Grade Three -ELLNA-REVIEWER-ENGLISH.pptxGrade Three -ELLNA-REVIEWER-ENGLISH.pptx
Grade Three -ELLNA-REVIEWER-ENGLISH.pptx
 
ClimART Action | eTwinning Project
ClimART Action    |    eTwinning ProjectClimART Action    |    eTwinning Project
ClimART Action | eTwinning Project
 
Unraveling Hypertext_ Analyzing Postmodern Elements in Literature.pptx
Unraveling Hypertext_ Analyzing  Postmodern Elements in  Literature.pptxUnraveling Hypertext_ Analyzing  Postmodern Elements in  Literature.pptx
Unraveling Hypertext_ Analyzing Postmodern Elements in Literature.pptx
 
Active Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdfActive Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdf
 
Transaction Management in Database Management System
Transaction Management in Database Management SystemTransaction Management in Database Management System
Transaction Management in Database Management System
 
DIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptx
DIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptxDIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptx
DIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptx
 

Huffman Coding Explained

  • 1. Huffman Coding Presented By: Ehtisham Ali
  • 2. Objectives What are Huffman Codes ? Why Huffman Codes are used ?
  • 3. Introduction An effective and widely used Application of Binary Trees and Priority Queues Developed by David.A.Huffman while he was a Ph.d student at MIT and published in the 1952 paper “A Method for the Construction of Minimum Redundancy Codes”. Each code is a binary string that is used for transmission of the corresponding message. For Example : BAGGAGE 100 11 0 0 11 0 101 Plain Text Huffman Code
  • 4. Major Steps baggage 1. Prepare the frequency table. 2. Construct the binary tree. Alphabets Frequencies 3. Extract the Huffman Code from the tree. b 1 a 2 g 3 Binary Tree e 1 This Huffman Code is now used for the transmission of word “baggage”. Huffman Code 100 11 0 0 11 0 101 b a g g a g e
  • 5. Algorithm n <- |C| Q <- C for i <- 1 to n-1 do allocate a new node z left [ z ] <- x <- EXTRACT-MIN (Q) right [ z ] <- y <- EXTRACT-MIN (Q) f [ z ] <- f [ x ] + f [ y ] INSERT(Q, Z) return EXTRACT-MIN (Q)
  • 6. Analysis Time Complexity: Time complexity of Huffman algorithm is O(nlogn) where each iteration requires O(logn) time to determine the cheapest weight and there would be O(n) iterations.
  • 7. Applications Of Huffman Coding Supports various file type as: ZIP (multichannel compression including text and other data types) JPEG MPEG (only upto 2 layers) Also used in steganography for JPEG carrier compression.
  • 8. Conclusion Like many other useful algorithms we do require Huffman Algorithm for compression of data so it could be transmitted over internet and other transmission channels properly. Huffman algorithm works on Binary trees. Huffman DATA Huffman Code Algorithm