CSC115 Lab 10 solution


Original Work


5/5 - (5 votes)

• Exposure to hash tables
• Practice with insertion into hash tables
Part I
1. Download, and to your Lab10
working directory. You will be implementing insert and get in 2 ways:
1) no collision handling and 2) collision handling with open addressing using linear probing.
2. has 5 TODO notes. Follow the instructions in each TODO note.
NOTE: has a hashCode function. You should call this function to get the hashcode for a
given student. Use the % operator to convert that hashcode to an index within the bounds of your table.
int hashcode = someStudentObject.hashcode();
int index = hashcode % SIZE_OF_TABLE;
CHECKPOINT (Ungraded) – After completing each of the following checkpoints, it might be a good time to
check-in with the TA if you are failing any of the tests in or struggling to figure out how to
proceed. Remember, please don’t hesitate to ask questions if you are unclear about anything.
CHECK POINT 1: TODO 1,2: implement and test insertCollisions and getCollisions methods
CHECK POINT 2: TODO 3: implement and test insertLinearProbing method
CHECK POINT 3: TODOs 4,5: implement and test getLinearProbing method
SUBMISSION (Graded) – Submit the file into the Lab 10 page on ConneX.