Current Forum: Homework 4 - Huffman Trees (Part 1) |
Date: Sun Oct 7 2001 3:17 pm |
Author: Maxim, Michael G. <mmaxim@andrew.cmu.edu> |
Subject: Re: the Huffman header |
|
|
The Huffman header produced by the writeHeader() function writes the characters and their frequencies. When you read this header back in during decompression, you use these stored frequencies to rebuild the code table. So basically you read in the frequencies and construct the Huffman tree from them, and traverse that tree to get the reconstructed code table. Then start reading the compressed data and looking in the code table you generated to get the originial character. |
|