0% found this document useful (0 votes)
4 views2 pages

Huffman Coding

Huffman coding is a lossless data compression algorithm that assigns variable-length binary codes to characters based on their frequencies, aiming to minimize the total number of bits used. The average code length achieved is 2.517 bits per character, with applications in data compression, image compression, and multimedia codecs. The time complexity for building the Huffman tree is O(n log n) and generating codes is O(n).

Uploaded by

Naveen Sharma
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views2 pages

Huffman Coding

Huffman coding is a lossless data compression algorithm that assigns variable-length binary codes to characters based on their frequencies, aiming to minimize the total number of bits used. The average code length achieved is 2.517 bits per character, with applications in data compression, image compression, and multimedia codecs. The time complexity for building the Huffman tree is O(n log n) and generating codes is O(n).

Uploaded by

Naveen Sharma
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Huffman Coding - Explanation and Tree

Huffman coding is a lossless data compression algorithm. It assigns variable-length binary codes to

input characters, with shorter codes assigned to more frequent characters. The goal is to reduce the

total number of bits used to represent data.

Given Characters and Frequencies:

a: 10, e: 15, i: 12, o: 3, u: 4, s: 13, t: 1

Huffman Codes:

i: 00

s: 01

e: 10

u: 1100

t: 11010

o: 11011

a: 111

Average Code Length: 2.517 bits per character

Applications of Huffman Coding:

- Data compression (e.g., ZIP files)

- Image compression (e.g., JPEG)

- Multimedia codecs (e.g., MP3)

Time Complexity:
- Building the Huffman Tree: O(n log n)

- Generating codes: O(n), where n is the number of characters.

You might also like