CS 222 01 Programming Assignment 05 – Chapter 05
CS 222 01
Programming Assignment 05 – Chapter 05
20 Points
Due: Friday, December 7, 2018
In the hash table program example used in class, the hash table size was chosen to be 47. If the table gets full, this needs to be increased. Re-implement the put method so that the table will automatically resize itself when the loading factor reaches a predetermined value (you can decided the value based on your assessment of load versus performance).
What will need to be done:
· Determine what you want to use as the loading factor
· Create a new hash table where the hash table size is the next a prime number at least 25% larger than the current table size. You will need to add code that will find the next prime number
· Re-hash all the current values in the hash table and put them in the new hash table
· Clear the old hash table and copy all the new values from the new hash table into the old hash table
Add the following comments to the beginning of the program.
Name: Your Name
Class and Section: CS 222 01
Assignment: Program Assignment 05
Due Date: See above
Date Turned in:
Program Description: You write a short description of what the program will do
When you complete the program, do the following.
1. Create a folder with the following name: ProgramAssignment05
2. Copy your program to this folder
3. Copy the folder to your folder in the I:\kopp\inbox\CS 222 01 folder