Write a C++ program that: (1) defines and implements a hash class that constructs a 15 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) + (second_letter) + (last_letter))% 15 (2) the driver program should: a. query the user for ten 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 10 of the 15 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).
Write a C++
(1) defines and implements a hash class that constructs a 15 element array (may be implemented using a
((first_letter) + (second_letter) + (last_letter))% 15
(2) the driver program should:
a. query the user for ten 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 10 of the 15 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).
Trending now
This is a popular solution!
Step by step
Solved in 2 steps