Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Question #5-Hash Table Implementation (30pts) Use the following steps to create a class called MyHash Table that will contain: An array of integers to store

image text in transcribed
Question #5-Hash Table Implementation (30pts) Use the following steps to create a class called MyHash Table that will contain: An array of integers to store the hash codes and a variable capacity to store the capacity of the array a) b) A constructor that initializes the capacity and the size of the array using a capacity generated by the nextPrime0 method c) The following methods: - insert0 inserts an element in the array.[Note: to make sure the index where the element will be stored is valid use element 90 capacity to generate the index) - clear: clears the array by recreating a new array - contain0 : returns true if the element is contained in the array - delete0: if the element exists stores a zero in the array. - isprime0 returns true if the number is prime. False if not - nextPrime0: generates the next prime number - PrintTable0 prints the hash table e) Use the following steps to create a class called TryMyHash Table to test out the MyHashTable you created above: -Use a Scanner to input the size of the hash table - Using a switch statement display a menu to perform the following operations in the hash table: 1. Insert, 2. Remove, 3. Contain and 4. Clear Use a loop to allow the user to perform all operations and print the hash table after performing cach operation

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Records And Database Management

Authors: Jeffrey R Stewart Ed D, Judith S Greene, Judith A Hickey

4th Edition

0070614741, 9780070614741

More Books

Students also viewed these Databases questions

Question

What is DDL?

Answered: 1 week ago