Starting from:

$35

CSE341-Assignment 1 Solved

Your task is to write a class which stores numbers using LISCH. You are provided with a header file which has the class definition inside; and a source file which you are supposed to complete.

 

You have five member functions to implement:

 

●     Constructor for the class: The parameter passed to the constructor represents the desired size of the hash table. Write necessary code to accommodate this.

●     insert: The parameter passed is the value to be inserted into the hash table. Write necessary code to insert this value to the hash table using LISCH logic.

●     find_num_probes: This function’s job is to find out how many ‘hops’ are required to find a certain key inside the hash table. Note that the number of probes for a given key must be at least 1 (i.e. if you find the key directly without following any links, the result should be 1). The parameter passed is the key to be searched for in the hash table. You can assume that the searched key always exists in the table.

●     find_average_num_probes: Computes average number of probes required to find a key in this table. Find how many probes it takes to find all keys inside the hash table, and divide it by the number of valid entries.

●     does_include:  Returns whether a given key exists inside the hash table or not.

 

DO NOT make any changes to the header file.​ 

 

DO NOT send a main function along with your work.​ 

 

DO NOT change the names of the files.​ 

 

 

More products