Home

About

Advanced Search

Browse by Discipline

Scientific Societies

E-print Alerts

Add E-prints

E-print Network
FAQHELPSITE MAPCONTACT US


  Advanced Search  

 
Program 4 Page 1 CS 2420 Fall 2010
 

Summary: Program 4 Page 1
CS 2420 Fall 2010
Program 4 20 points Check Eagle for due date.
Hash Tables
Objective: In this assignment you are to going to implement a hash table with linked list chaining, and
then use it to implement a concordance (Concordance: a list of words used in a body of work, with a
count of the number of times the word occurs).
Hash Tables
A hash table is a data structure that stores key/data pairs. When you add to a hash table you
provide both the key and the data. When you read from a hash table you give a key, and the data
structure returns the associated data. You can also test to see if any data is stored under the given
key. (In our case, there is really no data part (unless you count the occurenceCt).)
You will need to implement, at least, the following functions. Feel free to modify them as
desired:
HashTable(filename, size) constructor, initializes a hash table with the given table size and
insert keys from filename.
insert(key) inserts a key into the hash table
Pair * find (key) returns the Pair * of the key if the key is found in the hash table, and NULL
otherwise
bool deleteKey(key) removes the entry with the given key. It returns a Boolean to indicate

  

Source: Allan, Vicki H. - Department of Computer Science, Utah State University

 

Collections: Computer Technologies and Information Sciences