This preview shows pages 1–2. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.View Full Document
Unformatted text preview: CMSC 216 Project #3 Fall 2011 Hash Table II Due: October 21, 2011, 6:00PM In Project #2, you created a hash table with a fixed size. In this project, you will use the dynamic memory allocation techniques youve learned in lecture to: accomodate arbitrarily-sized keys and values add linked list chains to your hash table buckets, and dynamically expand the hash table as it becomes full In addition, you will use a modified version of the hash table testing program you wrote to write test cases for your hash table implementations. 1 Procedure 1.1 Obtain the project files We have supplied four files for your use in this project: (a) hashtable.h , which provides prototypes for the functions your hash table must implement; and also provides structure definitions, typedefs and symbolic constants to be used when implementing the new hash table. Note that this file is different from the one from Project #2; (b) a hashtester.o object file that is somewhat different from the hashtester program you wrote for Project #2; (c) a program named htester that is used to compare output from tester programs with the correct output; and (d) a .submit file, so you can submit to the submit server. The files are located in ~/216public/project3/project3.tgz . You should copy the tarfile file to your home directory and extract the files in a similar manner to the procedures you followed in previous projects. The use of the hashtester.o and htester files is described in detail in Section 2.4 . Your code for this project should be contained in your ~/216/project3 subdirectory, which was created by extracting the files from the tarfile. 1.2 Create a Makefile As we did for you for Project #2, you should create a Makefile that we will use to build the C public tests against your hash table implementation. Section 2.1 lists the targets you are required to implement, as well as any other requirements for your Makefile . 1.3 Implement the hash table Create a file named hashtable.c to hold your implementation of the hash table. Your hash tables will need to use the closed addressing, chaining approach described in detail in Section 2.2.1 . As in Project #2, the keys and values are strings, but the structures weve provided for you do not have buffers allocated to hold the strings, so you will need to allocate and free memory for them as necessary. 1.4 Write your tests The htester program accepts input files that have both commands and expected output. Your task for this project is to write a test suite of input files for the htester program, which should detect errors in an incorrect implementation. To work with our submit server testing setup, the input files you want to have graded must be named with the format testfileXX , where XX is a two digit number between 00 and 29....
View Full Document
This note was uploaded on 01/13/2012 for the course CMSC 216 taught by Professor Plane during the Spring '11 term at Maryland.
- Spring '11