Current Forum: Homework 4 - Huffman Trees (Part 1) |
Date: Fri Oct 5 2001 10:54 am |
Author: Cipriani, Jason A. <jac4@andrew.cmu.edu> |
Subject: Re: Best way to store the code table |
|
|
If you insist on storing the frequencies, you can always use some type of run-length encoding to compress the frequency table by reducing the size of the entries in the character/frequency table that have a frequency of 0.
You could always just store the prefix codes in the file, but you have the problem if knowing the size in bits of each prefix code when you read them. You could store them all fixed width, but a single prefix code can possibly get as long as 256 bits. You don't want to lose the ability to store codes like that. Even though its a rare occurence, it is a possibility. |
|