Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
courses:cs211:winter2018:journals:nasona:chapter4 [2018/03/11 20:24] – [4.8 Huffman Codes] nasonacourses:cs211:winter2018:journals:nasona:chapter4 [2018/03/11 22:01] (current) – [4.8 Huffman Codes] nasona
Line 303: Line 303:
  
 ==Summary== ==Summary==
 +We want to map encodings to letters so that no encoding is the prefix of another in order to avoid ambiguity. A prefix code that minimizes the average bits per letter is optimal. In other words, more frequently used letters should have shorter encodings in order to compress the data. A brute force algorithm is infeasible because the search space is so large and so variable. We will use a full binary tree to represent prefix codes all letters encoded will be leaf nodes to avoid any encoding being the prefix of another. Meta-letters will be interior nodes (parents to letters). The greedy aspect of Huffman's algorithm is that you merge the two lowest frequency letters in the algorithm. The bottom-up approach is the optimal approach. The runtime of the algorithm is O(klogk).
  
 ==The Problem== ==The Problem==
-  * A greedy rule is used to shrink the size of the problem instance so that an quivalent smaller problem can then be solved by recursion+  * A greedy rule is used to shrink the size of the problem instance so that an equivalent smaller problem can then be solved by recursion
   * The global consequences of the initial greedy decision do not become fully apparent until the full recursion is complete   * The global consequences of the initial greedy decision do not become fully apparent until the full recursion is complete
   * Data compression, an area that forms part of the foundation for digital communication   * Data compression, an area that forms part of the foundation for digital communication
courses/cs211/winter2018/journals/nasona/chapter4.1520799897.txt.gz · Last modified: by nasona
CC Attribution-Noncommercial-Share Alike 4.0 International
Driven by DokuWiki Recent changes RSS feed Valid CSS Valid XHTML 1.0