1 / 7

HUFFMAN CODING

HUFFMAN CODING. Anvitha Banakal Sadananda Neha Matroja CSE-5311 November 30, 2010 University of Texas of Arlington. HUFFMAN CODING Technique. Huffman coding  is a variable length encoding algorithm used for data compression. It is a greedy Algorithm.

ilyssa
Download Presentation

HUFFMAN CODING

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. HUFFMAN CODING Anvitha Banakal Sadananda Neha Matroja CSE-5311 November 30, 2010 University of Texas of Arlington

  2. HUFFMAN CODINGTechnique • Huffman coding is a variable length encoding algorithm used for data compression. It is a greedy Algorithm. • For given frequency of characters, we assign codes in such way that the length of encoding is as minimum as possible. DATA STRUCTURES USED • Table • Priority queue • Binary Tree

  3. 0 1 0 1 0 1 R B A 0 1 D C HUFFMAN CODINGTechnique Cont’d ABRACADABRA Frequencies A : 5 B : 2 C : 1 D : 1 R : 2 Code A : 00 B : 10 C : 010 D :110 R : 11 Encoded : 001011000100001100101100 (24 Bits) ASCII 8* 11= 88 bits

  4. HUFFMAN CODINGAlgorithm 1)Create a table with the fields : Serial No., Symbol , Weight, Representation 2) Create priority queue “Q”. Insert the symbols and frequencies in priority queue. 3) While there is more than one node in the queue: • 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) 4)Insert the representation in the HuffmanTree.

  5. HUFFMAN CODINGCompression Ratio • Compression ratio = Bits of encoded characters/Bits of original characters • The running time of the algorithm is O(nlogn). Compression Ratio File size (No. of Characters)

  6. REFERNCES : http://en.wikipedia.org/wiki/Huffman_coding http://www.graphviz.org/ http://www.experiencefestival.com/a/Data_compression/id/2000388 http://www.wordiq.com/definition/Huffman_coding http://paper.ijcsns.org/07_book/201005/20100520.pdf http://www.cs.utsa.edu/~wagner/laws/Ahuffmanc.html http://planetmath.org/encyclopedia/HuffmanCoding.html http://www.cs.duke.edu/csed/poop/huff/info/ http://www2.cs.usfca.edu/~galles/cs245S08/huffman08.pdf

  7. THANK YOU !!!

More Related