題組內容

4. Huffman tree : Huffimnan algorithm is a variable-length encoding method, in which a Huffiman tree is constructed. Suppose seven symbols A, B, C, D, E, F, G with frequencies 8, 15, 1, 6, 15, 3, 7, respectively, are given. You have to obey the following rules for constructing the Hufiman tree:

(3) If more than two nodes have the same least frequency, then you have to merge the two that bave the least and the second least label in lexical order. Please draw the full Huffman tree.