Discussion Board
Go to the previous messageGo to the following message
Current Forum: Homework 4 - Huffman Trees (Part 1)
Date: Thu Oct 11 2001 9:53 pm
Author: Chen, Richard <richardc@andrew.cmu.edu>
Subject: Re: Compare To for Huffman Tree Building

Yes, both files (HuffmanTree.java and HuffmanCharFreqs.java) need compareTo() methods. I feel like I'm wrong, though, so someone check me on that. You don't *have* to, though, since for example, my algo does not require the compareTo() method in both, but then again, I end up barely using HuffmanTree.java at all (which is a bad sign, even if my algo works).

Also: you don't need to detect if the object is a HuffmanTree type or not since you'll know that or else the proper compareTo() method in the proper file (HuffmanTree.java or HuffmanCharFreqs.java) could not be detected.

Casting should solve the problem of "detecting if the object is a HuffmanTree type or a HuffmanCharFreqs type."
Post response

Go to the previous messageGo to the following message
Current Thread Detail:
Compare To for Huffman Tree Building      Drozd, William A.      Tue Oct 9 2001 12:04 am       
Re: Compare To for Huffman Tree Bui...      Chen, Richard      Thu Oct 11 2001 9:53 pm       
Re: Compare To for Huffman Tree ...      Chen, Richard      Tue Oct 16 2001 4:15 am       

Back to previous screen