Next: The HuffTree
Up: Assignment 11: Huffman Codes
Previous: Assignment 11: Huffman Codes
Create a class called FreqTab that builds a
table that contains the frequency of letters in a text sample.
- You can use an array, Vector or Hashtable to implement
the frequency table.
- You might want to pass the text sample as a parameter
to the FreqTab constructor, and make the frequency table
an instance variable.
- You should write a method that prints the contents of the
table.
- Rather than allow client code direct access to the contents
of the table, you should provide accessor methods. For example,
you might write frequency, which takes a letter (character)
and returns the number of times it appears in the sample text.
Allen Downey
Mon Nov 20 11:50:58 EST 2000