next up previous
Next: About this document

Assignment 11: Huffman Codes

Due: Wednesday 6 December

Read the handout from The Practice of Programming and write a program that reads a text file and then generates 1000 random words using the Markov algorithm.

For this assignment, it is up to you to design the program pretty much from scratch.

I have one hint and one warning: the hint is that I think the data structure Kernighan and Pike use is not the best choice. The warning is that there is a Java version of this program in the book, but you should avoid looking at it, because it will probably be more confusing than helpful, not to mention posing a moral hazard.

If you are careful in your design I think you can create an implementation of this algorithm that is much nicer than theirs.





Allen Downey
Tue Nov 28 11:51:55 EST 2000