CS 35

Program 8

due Tuesday 3 April by midnight

In /home/cfk/pub/cs35/week9/huffman/, you will find slightly modified code from chapter 12 of Weiss to implement text file compression using Huffman's algorithm. This code uses the Java Collections PriorityQueue. It is used in the createTree method in the class HuffmanTree which is inside the file Hzip.hava. The methods used are: the constructor, add, size, remove, and element. I want you to write two versions of your own PriorityQueue class that provide just these methods. I want one of your classes to use linked lists and the second of your classes to use a binary heap. Have the constructor of your class output to the screen the message "Using x's y priority queue.", where x is your cs login and y is either linked list or binary heap. The most important part of this assignment is for you to throughly understand a binary heap. You may use or modify the code in Weiss. Just make sure you understand all that you use.