Question: Question 2 : 30 points An open hash table (also called separate chaining) is an array of linked lists. When a value is hashed, we

Question 2 : 30 points An open hash table (also called separate chaining) is an array of linked lists. When a value is hashed, we use the hash as an array index and add the value to the linked list at that array position. If elements collide, both are put into the linked list. We will use a very simple hash function to make our computations easier. We will now insert the values 9, 13, 14, 3, 21 into an open hash table with 4 spaces. h(9, 4) =1 h(13, 4) =1 h(14, 4) =2 h(3, 4) =3 h(21, 4) =1 3 The hash table now looks like this: Index Values (list) 0 None 1 9 , 13, 21 2 14 3 If we insert N elements into an array of size S, on average, each slot will have elements. Selecting a good ratio between the size of the table and number of elements will produce a more efficient data structure. Insert the following values into an open hash table with size S = 10: 45, 27, 100, 20, 9, 24, 2, 13, 50, 121. Show the final hash table with all elements inserted. 3 points per element in the correct location
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
