T Naughton, CS NUIM
Back to CS211 home
Repeat of Problem 9.1 Design and write a simple hash table class to store 10 ISBN numbers. For the purposes of this assignment assume that ISBN numbers are strings of 10 characters. You will need a class to describe each node of the hash table (containing a string or character array ISBN number as the key) and a class to maintain an array of such nodes. Methods in this latter class should include adding to the hash table, printing the hash table, and checking if the hash table if full. Define a hash function of your own (it can be anything you like!).
To help you along, here is a possibility for the first class:
const int ISBNSize = 11; // one more than required (extra space for \0)
const int TitleSize = 50;
enum EntryType {USED, EMPTY, DELETED};
class HashEntry {
public:
char isbn[ISBNSize]; // the key
char title[TitleSize]; // name of the book
EntryType status; // status of this hash table element
};