posted 12 years ago
Alright so we have to implement a basic hash table for an assignment. It seems so simple but it's kicking my ass.
Basically what we have is an input file that contains the amount of entries on the first line and a dns record on each subsequent line.
So we are meant to make 3 classes: DNSKey, Record and HashTable.
These are the outlines they've given us
I have been trying to use an array of DNSKey's which are placed into a position decided by the hash function. I am however unsure if I even need an array of DNSKey's or if they should be hashed. So I'm basically wondering how I would map those DNSKey's to a record and placing that record
into the hashtable, while keeping track of the duplicates. The rest of the code basically follows the specification although I am a little unsure on how I would go about the HashTable class.
Here is the code I'm using to do what I explained:
And HashTable class
At the end I basically have to output the DNS key that occured the most and the amount of times it occured.
Thanks a ton if anyone can help/\.