Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Need this written in C++ with detailed documentation and screen shot of code Write a C++ program that: (1) defines and implements a hash class

image text in transcribed
Need this written in C++ with detailed documentation and screen shot of code
Write a C++ program that: (1) defines and implements a hash class that constructs a 23 element array (may be implemented using a vector, a deque, or a list, if you prefer), storing strings, using the following hash function: (first letter) +(last letter)%23 So, for example, the word "rocky" would be (Y) = 114 + ('y') = 121 = 235%23-5 In this example, an attempt would be made to store "rocky" in position 5. In the event of a collision, the word would be stored in the first available location, so if there is a collision in location 5, an attempt would be made to store the word in location 6. If there is a collision in location 6, try location 7 and so on. (2) the driver program should: a. query the user for fifteen words and store them using the hash technique described above. b. print out the contents of each position of the array (or vector, deque, or whatever you used), showing vacant as well as filled positions. Remember, only 15 of the 23 positions will be filled. c. repeatedly query the user for a target word, hash the word, check for its inclusion in the list of stored words, and report the result. Continue doing this task until the user signals to stop (establish a sentinel condition). A solution that does not involve defining and using a hash class is not acceptable

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

Database Design Using Entity Relationship Diagrams

Authors: Sikha Saha Bagui, Richard Walsh Earp

3rd Edition

103201718X, 978-1032017181

More Books

Students also viewed these Databases questions

Question

64 Incident and emergency response plans.

Answered: 1 week ago