Question: PLEASE HELP WITH THIS ASSIGNMENT AND PLEASE USE YOUR OWN ORIGINAL CODE..PLEASE READ INSTRUCTIONS CAREFULLY Hash Table with Chaining Description In this assignment you are

PLEASE HELP WITH THIS ASSIGNMENT AND PLEASE USE YOUR OWN ORIGINAL CODE..PLEASE READ INSTRUCTIONS CAREFULLY

PLEASE HELP WITH THIS ASSIGNMENT AND PLEASE USE YOUR OWN ORIGINAL CODE..PLEASE

READ INSTRUCTIONS CAREFULLY Hash Table with Chaining Description In this assignment you

Hash Table with Chaining Description In this assignment you are requested to implement a hash table that handles collisions by chaining. You have to use linked lists, either from the Standard Template Library (STL) (recommended) or by implementing your own. For usage of STL, refer for instance to http: //www.cppreference.com/wiki. You need to implement the insert, search and delete operations. The keys are integers (C++ int type) and you can assume that all keys are non-negative. The first number in the input will be the size m of the chained hash table. You will use the simple hash function h(k)- k mod m Then lines will follow starting with 'i, s, d,'o, or e'. The details are as follows Use the hash function h(k) k mod m 1(key): Insert (key) into the table. For example, "i2" implies "Insert key 2 into the table." For collisions, insert the colliding key at the beginning of the linked list. You just need to insert the key and don't have to output anything in this case. d(key): delete (key) from the table. For example, d2 implies "Delete key 2 from the table." If there are multiple elements of the same key value, delete the element of the key value that appears the earliest in the list. If the delete was successful, you have to output (key) :DELETED If not (since there was no element with the key value), output (key) :DELETE FAILED; #5(key): search (key) in the table. If there is an element with the key value, then you have to output Hash Table with Chaining Description In this assignment you are requested to implement a hash table that handles collisions by chaining. You have to use linked lists, either from the Standard Template Library (STL) (recommended) or by implementing your own. For usage of STL, refer for instance to http: //www.cppreference.com/wiki. You need to implement the insert, search and delete operations. The keys are integers (C++ int type) and you can assume that all keys are non-negative. The first number in the input will be the size m of the chained hash table. You will use the simple hash function h(k)- k mod m Then lines will follow starting with 'i, s, d,'o, or e'. The details are as follows Use the hash function h(k) k mod m 1(key): Insert (key) into the table. For example, "i2" implies "Insert key 2 into the table." For collisions, insert the colliding key at the beginning of the linked list. You just need to insert the key and don't have to output anything in this case. d(key): delete (key) from the table. For example, d2 implies "Delete key 2 from the table." If there are multiple elements of the same key value, delete the element of the key value that appears the earliest in the list. If the delete was successful, you have to output (key) :DELETED If not (since there was no element with the key value), output (key) :DELETE FAILED; #5(key): search (key) in the table. If there is an element with the key value, then you have to output

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!