This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
Unformatted text preview: MondayData CompressionEncoding of strings/textFixed Length EncodingEach character is represented with the same number of bits: ExampleASCII: 1 byte/charUNICODE: 2 bytes/charVariable Length EncodingUses binary codes of different lengths to represent each characterPrefix rule in variable length encodingTo prevent ambiguities in each variable length encoding, each encoding should not be the prefix of another encoding011 – A010 – B10 – C010 10 011B C AThis encoding follows prefix rule and it is unambiguousWe use an “encoding trie” to represent the encoding to enforce the prefix ruleABRACADABRAIn ASCII it is going to be 8 bits/char 8*8 = 64 bits using ASCII.Using this variable length encoding 29 bits in totalDifferent encoding tries give different degrees of compressionWe want the characters that appear more often to have the shortest encoding so the compressed string will be shorter.Huffman Encoding TrieThis is an algorithm that finds the optimal encoding for a given stringIt builds the trie bottom up using characters/subtrees of smaller frequency first.ABRACADABRAHistogramChar  ABRCD#  52211Step 152211ABRCDStep 22/ \52211ABRCDStep 342/ \ / \52211ABRCDStep 46/\42/ \/ \52211ABRCDStep 511/ \56A / \4 2/ \ / \2 2 1 1B R C DA = 0B = 100R = 101C = 110D = 111ABRACADABRATotal # of bits = 23, before it was 29 bits...
View
Full Document
 Fall '08
 Staff
 Graph Theory, Data Structures, Variable length, Planar graph, vertices, Directed acyclic graph

Click to edit the document details