Professional Documents
Culture Documents
Input
-----
One line for each string. The characters of the line
are just the characters of the string. The string will
consist only of lower case letters, and will not be
longer than 80 letters.
The input will end with an end of file.
Output
------
One line for each string, beginning with `String #:' and
ending with the name of a Huffman Coding Tree for the
string. This tree must obey the rule we gave above to
reduce ambiguity. If there is more than one tree obey-
ing this rule, output only one tree.
Sample Input
------ -----
abaacb
abbcccddddeeeeeffffffggggggghhhhhhhh
Sample Output
------ ------
String 1: (a)((b)(c))
String 2: (((((a)(b))(c))(f))((d)(e)))((g)(h))
File: huffman.txt
Author: Bob Walton <walton@deas.harvard.edu>
Date: Thu Oct 11 13:14:29 EDT 2001
The authors have placed this file in the public domain;
they make no warranty and accept no liability for this
file.
RCS Info (may not be true date or author):
$Author: walton $
$Date: 2001/10/11 17:18:49 $
$RCSfile: huffman.txt,v $
$Revision: 1.3 $