Discussion Board
Go to the previous messageGo to the following message
Current Forum: Homework 4 - Huffman Trees (Part 1)
Date: Mon Oct 15 2001 7:04 pm
Author: Lee, Charles C. <chucklee@cmu.edu>
Subject: Re: "findMin()" and/or "removeMin()"

You can try using a TreeSet which sorts the elements automatically from least to greatest. So the minimum is just the first element. But the problem with TreeSets is that it cannot distinguish the difference between two characters with the same frequencies.

It's not too hard or time consuming to write it yourself a data structure that has both of the above functions. Let me give you a hint: Try implementing vector as your queue.
Post response

Go to the previous messageGo to the following message
Current Thread Detail:
"findMin()" and/or "removeMin()"      Chen, Richard      Mon Oct 15 2001 11:09 am       
Re: "findMin()" and/or "removeMin()"      Lee, Charles C.      Mon Oct 15 2001 7:04 pm       
Re: "findMin()" and/or "removeMi...      Chen, Richard      Tue Oct 16 2001 1:09 am       
Re: "findMin()" and/or "remov...      Lee, Charles C.      Tue Oct 16 2001 6:21 pm       
Re: "findMin()" and/or "re...      Chen, Richard      Wed Oct 24 2001 4:06 am       

Back to previous screen