CS 222 Fall 2005, Instructor: Jeffrey Horn
Homework
4 program 3: FAST WEB CACHE (open hashing, template un-use, overloading,
and destructors)
DATES: Handed out:
Thursday, October 20, 2005
Due: October 31, 2005
PURPOSE:
-
Implement open hashing with linked lists
-
Get rid of templates
-
Overload operators
-
Write destructors
OVERALL:
The problem setting is as described in class: you
are to maintain a history of all web page seen so far, using a hashtable
for efficient inserts, deletes, and lookups (member checks)
STEPS:
-
Download all of these files into your own directory.
The code is in ~jeffhorn/pub/Classes/CS222/Fall2005/HW4/Code or
http://cs.nmu.edu/~jeffhorn/Classes/CS222/Fall2005/HW4/Code
-
Remove all of the templating from LinkedListT and NodeT classes,
so that your versions are hardcoded to the elementType "WebPage".
-
Implement all of the hashtable methods indicated in "hashtable.h"
and "hashtable.cc"
-
In main, substitute your hashtable class for the "WebCache"
class.
-
Add code to main for initializing hashtable with the
data already in the unsorted array (currentPages).
-
Test your code.
- Implement all of the destructors (in hash table, and node
classes) so that they work together. You can assume the destructor
for linked list works correctly, but feel free to modify it!
- AND INCLUDE YOUR NAME, DATE, AND ASSIGNMENT INFO AT TOP OF
YOUR COMMENTS!!!
- Hand-in (see bottom)
WHAT TO TURN IN:
Your entire project folder, with all needed files in the right subfolders (if
you use any subfolders), compressed into one file and submitted to the
assignment 4 dropbox in our webCT folder.