Chapter 11: Trees
Q27E
construct a Huffman code for the letters of the English alphabet where the frequencies of letters in typical English text are as shown in this table.
Frequency Letter
Letter | Frequency | Letter | Frequency |
A | 0.0817 | N | 0.0662 |
B | 0.0145 | O | 0.0781 |
C | 0.0248 | P | 0.0156 |
D | 0.0431 | Q | 0.0009 |
E | 0.1232 | R | 0.0572 |
F | 0.0209 | S | 0.0628 |
G | 0.0182 | T | 0.0905 |
H | 0.0668 | U | 0.0304 |
I | 0.0689 | V | 0.0102 |
J | 0.0010 | W | 0.0264 |
K | 0.0080 | X | 0.0015 |
L | 0.0397 | Y | 0.0211 |
M | 0.0277 | Z | 0.0005 |
Suppose that \({\bf{m}}\) is a positive integer with \({\bf{m}} \ge {\bf{2}}\). An m-ray Huffman code for a set of \({\bf{N}}\) symbols can be constructed analogously to the construction of a binary Huffman code. At the initial step, \(\left( {\left( {{\bf{N - 1}}} \right){\bf{ mod }}\left( {{\bf{m - 1}}} \right)} \right){\bf{ + 1}}\) trees consisting of a
single vertex with least weights is combined into a rooted tree with these vertices as leaves. At each subsequent step ,the \({\bf{m}}\) trees of least weight are combined into an m-ray tree.
Q27E
Prove that Sollin’s algorithm produces a minimum spanning tree in a connected undirected weighted graph.
Q27SE
Which of these graphs are cacti?
Q28E
How many vertices and how many leaves does a complete \({\bf{m - }}\)ary tree of height \(h\) have?
Q28E
Use backtracking to find a subset, if it exists, of the set {27, 24, 19, 14, 11, 8} with sum
a) 20. b) 41. c) 60.
Q28E
Describe the m-aryx Huffman coding algorithm in pseudocode.
Q28E
Show that the first step of Sollin’s algorithm produces a forest containing at least \(\left\lceil {\frac{n}{2}} \right\rceil \) edges when the input isan undirected graph with \(n\) vertices.
Q28E
Show that preorder traversals of the two ordered rooted trees displayed below produce the same list of vertices. Note that this does not contradict the statement in Exercise 26, because the numbers of children of internal vertices in the two ordered rooted trees differ.
Q28SE
Is a tree necessarily a cactus?
Q29E
Prove
\({\bf{a)}}\)part \(\left( {ii} \right)\) of Theorem \(4\).
\({\bf{b)}}\)part \(\left( {{\bf{iii}}} \right)\) of Theorem \(4\).