Question: You are required to complete 5 functions for hashtable which is a list. (Must be done in Python) Please refer to the question for each

You are required to complete 5 functions for hashtable which is a list. (Must be done in Python)

Please refer to the question for each function. Also, there are test codes and required outputs for all of the functions.

Function 1:

You are required to complete 5 functions for hashtable which is a

list. (Must be done in Python) Please refer to the question for

Function 2:

each function. Also, there are test codes and required outputs for all

of the functions. Function 1: Function 2: Function 3: Function 4: Function

Function 3:

5 Write a function called insert_key0 that inserts a key into a

hashtable, represented by a list, using the hash function: index = key

Function 4:

% (length of hashtable) As parameters the function will take a key

to insert and a list representing the hashtable. You may assume no

Function 5

collisions will occur and there will be space for the value. The

'None' value will be used to represent empty positions in the hashtable.

Write a function called insert_key0 that inserts a key into a hashtable, represented by a list, using the hash function: index = key % (length of hashtable) As parameters the function will take a key to insert and a list representing the hashtable. You may assume no collisions will occur and there will be space for the value. The 'None' value will be used to represent empty positions in the hashtable. e.g: hashtable [0,1,2,3,None,5,None,7] insert_key(12, hashtable) print(hashtable) output: [0, 1, 2, 3, 12, 5, None, 7] Answer: (penalty regime: 0 %) 1-] def insert_keyCkey, hashtable)

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!