Question: Need a little help For this exercise, you will implement the following methods for a Hash Table: A function that computes the hash of a
Need a little help
For this exercise, you will implement the following methods for a Hash Table: A function that computes the hash of a key and the linear probing function, as well as the insert function. You will also need to implement the class for the Hash Table. For bonus points, the hashing function is worth 2 points, the linear probing function is worth 3 points, and the insert is worth 5 points. Note: You need to implement a partial class for testing. The data is stored as an array of the class, with the index being the hash of a key and each array element being a pointer to a Node. The node class (which can simply be a structure), should also be created and should have a key attribute and value attribute.
Define class Node: Key: integer, public
Value: Integer, public //Note: typically, value is templated to support multiple types, but for simplicity lets just support integers.
Define class HashTable Table:
Array of Node Pointers, private
Size: Integer, private
Table(s: Integer): Constructor, public
Allocate Table of size s.
Set all pointers to NULL.
Size is set to s.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
