






Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!







CS245-2009S-P Project 2 1
P2-0: Text Files
P2-1: ASCII
P2-2: ASCII
P2-3: ASCII
P2-4: Representing Codes as Trees
P2-5: Representing Codes as Trees
P2-6: Representing Codes as Trees
CS245-2009S-P Project 2 2
P2-7: Representing Codes as Trees
P2-8: Representing Codes as Trees
P2-9: Prefix Codes
CS245-2009S-P Project 2 4
P2-15: File Length
How many bits are required to encode a file of 20 characters?
P2-16: File Length
How many bits are required to encode a file of:
P2-17: File Length
How many bits are required to encode a file of:
P2-18: Decoding Files
c
d
0 1
0
0
1
a^1
b
P2-19: Decoding Files
CS245-2009S-P Project 2 5
P2-20: Decoding Files
P2-21: File Compression
P2-22: File Compression
P2-23: Huffman Coding
P2-24: Huffman Coding
P2-25: Huffman Coding
CS245-2009S-P Project 2 7
a:
d:
c:
b:
:
P2-29: Huffman Coding
P2-30: Huffman Coding
P2-31: Huffman Coding
P2-32: Huffman Coding
Project 2 8
a:10 b:10 c:10 d:
:20 :20 e:
:
P2-33: Huffman Coding
P2-34: Huffman Trees & Tables
P2-35: Encoding Tables
CS245-2009S-P Project 2 10
public void writeBit(boolean bit)
public void close()
P2-40: Binary Files
P2-41: Binary Files
P2-42: Binary Files
P2-43: Binary Files
P2-44: Printing out Trees
CS245-2009S-P Project 2 11
P2-45: Compression?
P2-46: Compression?
P2-47: Compression?
P2-48: Compression!
P2-49: Compression!
P2-50: Compression!
∑ c f req(c)^ ∗^ len(c)
P2-51: Compression!
P2-52: Compression!
∑ c f req(c)^ ∗^ len(c)^ +