Question: Prob 1 . Given the input list S = [ 7 9 , 2 8 , 4 9 , 1 7 , 6 8 ]

Prob 1. Given the input list S=[79,28,49,17,68], assume we want to use a hash table with the length of 8. Please answer the following questions:
a) Please list the potential benefits of hash table.
b) Assuming we need to use the hashing function modular division: h(k)= k mod N, where N is the length of the hash table, do we have the collision? How can we be able to handle the collison (list 3 possible methods)?
c) Assuming we consider modular division: h(k)= k mod N, if you are required to use the separate chain table to handle the collision, please draw the steps that we need to insert the elements in S=[79,28,49,17,68] into an empty hash table.
d) Assuming we consider modular division: h(k)= k mod N, if you are required to use the linear probing to handle the collision, please draw the steps that we need to insert the elements in S=[79,28,49,17,68] into an empty hash table.
e) Assuming we consider modular division: h(k)= k mod N, if you are required to use the quadratic probing to handle the collision, please draw the steps to insert the elements in S=[79,28,49,17,68] into an empty hash table.
e) Assuming we consider modular division: h(k)= k mod N and h(k)=3-(k mod 3), if you are required to use the double hashing to handle the collision, please draw the steps to insert the elements in S=[79,28,49,17,68] into an empty hash table.
Prob 2. Assuming you work for a marketing company and you have 10 customers living in a small community. Based on the posted information, you have the following information:
Emma and Liam are friends. Liam and Olivia are classmates. Liam and Isabella know each other. Olivia and Jackson are dating. Liam and Lucas had a road trip together. Locas and Sophia were close friend. Liam and Noah are doing the senior design together. Noah and Ava are in a small study group. Aiden and Isabella did field study together. Oliva and Ava go to the same church and belongs to the same group. Ava and Aiden are siblings.
a) Your manager requests you to develop an algorithm to group the existing customers into different social networks. What kind of algorithm you can use?
b) Please use the UFConnectedComponents function to classify customers into disjoint social networks. List your steps.
c) Please use the tree-based implementation and consider the path compression at the same time. List your steps.

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 Programming Questions!