Discussion Board
Go to the previous messageGo to the following message
Current Forum: Homework 4 - Huffman Trees (Part 1)
Date: Mon Oct 8 2001 11:13 pm
Author: Lee, Charles C. <chucklee@cmu.edu>
Subject: Re: general clarification on FileBitReader/Writer classes

You can use BitReader to get the ascii value of each character and what you can do is make an array of length 256 (number of ascii characters). So when you encounter a byte value of 65, you up the frequency in the array index 65 by 1 and build your freq array that way, or you can use a vector.

For writing it to the compressed file, use bit strings to represent the code and you can use int to store the bitstring. and you can use writeBits(int,int) to write the bitstrings out.
Post response

Go to the previous messageGo to the following message
Current Thread Detail:
general clarification on FileBitReader...      Liu, William Y.      Mon Oct 8 2001 10:34 pm       
Re: general clarification on FileBi...      Lee, Charles C.      Mon Oct 8 2001 11:13 pm       
Re: general clarification on Fil...      Cipriani, Jason A.      Mon Oct 8 2001 11:30 pm       
Re: general clarification on ...      Bortz, Andrew S.      Tue Oct 9 2001 12:28 am       
Re: general clarification ...      Cipriani, Jason A.      Wed Oct 10 2001 1:01 am       
Re: general clarificati...      Bortz, Andrew S.      Wed Oct 10 2001 11:04 am       
Re: general clarific...      Cipriani, Jason A.      Wed Oct 10 2001 12:45 pm       
Re: general clarific...      Cipriani, Jason A.      Wed Oct 10 2001 12:50 pm       
Re: general clari...      Cipriani, Jason A.      Wed Oct 10 2001 12:51 pm       

Back to previous screen