Chapter 5: Q13E (page 162)
A long string consists of the four characters ; they appear with frequency and respectively. What is the Huffman encoding of these four characters?
Short Answer
Huffman encoding of the characters is respectively.
/*! This file is auto-generated */ .wp-block-button__link{color:#fff;background-color:#32373c;border-radius:9999px;box-shadow:none;text-decoration:none;padding:calc(.667em + 2px) calc(1.333em + 2px);font-size:1.125em}.wp-block-file__button{background:#32373c;color:#fff;text-decoration:none}
Learning Materials
Features
Discover
Chapter 5: Q13E (page 162)
A long string consists of the four characters ; they appear with frequency and respectively. What is the Huffman encoding of these four characters?
Huffman encoding of the characters is respectively.
All the tools & learning materials you need for study success - in one app.
Get started for free
Consider an undirected graph with nonnegative edge weights role="math" localid="1658915178951" . Suppose that you have computed a minimum spanning tree of G, and that you have also computed shortest paths to all nodes from a particular node role="math" localid="1658915296891" . Now suppose each edge weight is increased by 1: the new weights are .
(a) Does the minimum spanning tree change? Give an example where it changes or prove it cannot change.
(b) Do the shortest paths change? Give an example where they change or prove they cannot change.
The following table gives the frequencies of the letters of the English language (including the blank for separating words) in a particular corpus.
blank | 18.3% | r | 4.8% | y | 1.6% |
e | 10.2% | d | 3.5% | p | 1.6% |
t | 7.7% | l | 3.4% | b | 1.3% |
a | 6.8% | c | 2.6% | v | 0.9% |
o | 5.9% | u | 2.4% | k | 0.6% |
i | 5.8% | m | 2.1% | j | 0.2% |
n | 5.5% | w | 1.9% | x | 0.2% |
s | 5.1% | f | 1.8% | q | 0.1% |
h | 4.9% | g | 1.7% | z | 0.1% |
(see the box in page 143). Would you expect it to be larger or smaller than your answer above? Explain.
d. Do you think that this is the limit of how much English text can be compressed? What features of the English language, besides letters and their frequencies, should a better compression scheme take into account?
Give the state of the disjoint-sets data structure after the following sequence of operations, starting from singleton sets . Usepath compression. In the case of ties, always make the lower numbered root point to the higher numbered ones.
Under a Huffman encoding of symbols with frequencies , what is the longest a codeword could possibly be? Give an example set of frequencies that would produce this case.
Sometimes we want light spanning trees with certain special properties. Here’s an example.
Input: Undirected graph G=(V,E) ; edge weights we; subset of vertices
Output: The lightest spanning tree in which the nodes of U are leaves (there might be other leaves in this tree as well).
(The answer isn’t necessarily a minimum spanning tree.)
Give an algorithm for this problem which runs in time. (Hint: When you remove nodes Ufrom the optimal solution, what is left?)
What do you think about this solution?
We value your feedback to improve our textbook solutions.