Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | |||
courses:cs211:winter2011:journals:wendy:chapter4 [2011/03/01 14:55] – [Section 7: Clustering] shangw | courses:cs211:winter2011:journals:wendy:chapter4 [2011/03/02 04:59] (current) – shangw | ||
---|---|---|---|
Line 84: | Line 84: | ||
This section is quite short but the application of the minimum spanning tree is interesting. | This section is quite short but the application of the minimum spanning tree is interesting. | ||
+ | |||
+ | ===== Section 8: Huffman Code and Data Compression ===== | ||
+ | |||
+ | This section introduces us the Huffman Code and how to use greedy algorithm to achieve. | ||
+ | |||
+ | First, the book gradually introduces the origin of Huffman coding from using 1,0 bits representing letters, the different frequency of usage of letters in English, the Morse code which is similar but easier with the pausing, Prefix codes and the way to calculate the optimal prefix codes (minimize the sum of frequency*bit-length). | ||
+ | |||
+ | To begin design the algorithm, intuitively the Binary Tree comes to mind because if we only use the leaves to represent letters then it is gonna be prefix code since no parent is involved. It is not hard to see that the optimal prefix code corresponds with some full binary tree. Now we attempt to construct the algorithm to build such a full binary tree. The Top-Down Approach as in the S-F code is the first try, unfortunately the example used earlier is already a counter example. To perfectly modify this approach needs to borrow knowledge from dynamic programming, | ||
+ | |||
+ | Compression is not always as easy as the Huffman coding. Tow major challenges are the " | ||
+ | |||
+ | I like the structure of this section because it tends to " | ||
+ | |||
+ | Readability is 8. | ||
+ |