CSC115 Lab 10 solution

$30.00

Original Work ?
Category: You will Instantly receive a download link for .ZIP solution file upon Payment

Description

5/5 - (5 votes)

Objectives
• Exposure to hash tables
• Practice with insertion into hash tables
Part I
1. Download Lab10Tester.java, Hashtable.java and Student.java 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. Lab10Tester.java has 5 TODO notes. Follow the instructions in each TODO note.
NOTE: Student.java 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.
Example:
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 Lab10Tester.java 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 Hashtable.java file into the Lab 10 page on ConneX.