Question: Write a Java program that implements a hash-table with the following functionalities: 1. An Array-List of size of 5. 2. Hash function is x%5. 3.

Write a Java program that implements a hash-table with the following functionalities:

1. An Array-List of size of 5.

2. Hash function is x%5.

3. In the main method create a hash-table object and add the following values: (5, 3, 7, 4,18, 2, 6, 8, 11, 5, 1, 9).

4. The hash-table should solve collision problem by inserting the colliding values into a Linked-List.

5. Print the output of index 4 on the screen.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!