Question: Your program should include: A class to hold the key-value pairs A class to hold the array of key-value pairs A method to add data

Your program should include:

A class to hold the key-value pairs

A class to hold the array of key-value pairs

A method to add data to the table

Since the hash function and collision resolution method are so simple, include them in this method, or write separate methods for them.

Input is down below.

Input :

2677502 Abay

2738074 Abdellah

2775833 Ahmad

2788141 Aidan

2702122 Alexander

2824376 Ali

2788887 Angelo

2782129 Arin

2731942 Aslanbek

2753042 Assaad

2716448 Cameron

2782402 Christianna

2814077 Colin

2775505 Corey

2781156 Darrius

2778355 David

2629054 Gina

2739543 Hassan

2813875 John

2784758 Juliana

2742158 Kamal

2775839 Kayla

2771277 Logan

2757960 Lukas

2744456 Micah

2729063 Phillip

2775826 Tony

2743687 Tru

2752726 Zakariya

A method to double the size of the array when needed, and a rehash method to go along with it.

A way to print out the contents of the hash table for testing.

Test your program with a separate class for the driver, or just put a main method in the same class as the array of key-value pairs.

Implement a search method: Given a key, return the value associated with that key

Step by Step Solution

3.49 Rating (152 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Heres a Java implementation of a hash table with the specified functionality import javautilArrayLis... View full answer

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 Programming Questions!