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. |
|