Discussion Board
Go to the previous messageGo to the following message
Current Forum: Homework 4 General Forum
Date: Thu Oct 4 2001 9:31 pm
Author: Cipriani, Jason A. <jac4@andrew.cmu.edu>
Subject: Re: modifying FileBitReader/FileBitWriter

well, my implementation takes 1 bit for each "fork" in the tree, and 9 bits for each character.

so, the maximum amount is 1*255 + 9*256 = 2559 bits = 320 bytes in the worst case.

storing frequencies is 32 bits * 256 characters = 8192 bits = 1024 bytes in the worst case.

i would hardly say that storing frequencies is better in the worst case. as a matter of fact, storing frequencies can NEVER be better unless you are using less than 10 bits per character. that limits you to 1024 for the value of the frequency count.

so, recursively storing the tree is better in all cases.
Post response

Go to the previous messageGo to the following message
Current Thread Detail:
modifying FileBitReader/FileBitWriter      Cipriani, Jason A.      Thu Oct 4 2001 12:09 am       
Re: modifying FileBitReader/FileBit...      Detwiler, Jay T.      Thu Oct 4 2001 9:32 am       
Re: modifying FileBitReader/File...      Cipriani, Jason A.      Thu Oct 4 2001 10:24 am       
Re: modifying FileBitReader/F...      Lee, Peter      Thu Oct 4 2001 1:48 pm       
Re: modifying FileBitReade...      Cipriani, Jason A.      Thu Oct 4 2001 3:51 pm       
Re: modifying FileBitRe...      Liu, Limin Angela      Thu Oct 4 2001 4:13 pm       
Re: modifying FileBi...      Cipriani, Jason A.      Thu Oct 4 2001 6:28 pm       
Re: modifying Fil...      Bortz, Andrew S.      Thu Oct 4 2001 8:06 pm       
Re: modifying ...      Cipriani, Jason A.      Thu Oct 4 2001 9:31 pm       
Re: modifyi...      Bortz, Andrew S.      Thu Oct 4 2001 10:06 pm       
Re: modify...      Cipriani, Jason A.      Fri Oct 5 2001 10:12 am       
Re: modify...      Cipriani, Jason A.      Fri Oct 5 2001 10:44 am       
Re: modify...      Cipriani, Jason A.      Fri Oct 5 2001 10:45 am       
Re: modifying FileBitReader/FileBit...      Maxim, Michael G.      Fri Oct 5 2001 6:12 pm       
Re: modifying FileBitReader/File...      Cipriani, Jason A.      Sat Oct 6 2001 10:28 am       
Re: modifying FileBitReader/F...      Bortz, Andrew S.      Sat Oct 6 2001 3:49 pm       

Back to previous screen