Write a program (in c++ or Matlab language) that implements the perfect hashing
ID: 3850521 • Letter: W
Question
Write a program (in c++ or Matlab language) that implements the perfect hashing scheme. Submit both a listing of source code AS WELL AS the results of running program on the input given below where the output shows ALL of the following: (i) the square array formed from the input, (ii) the array with each row shifted to the right as necessary, (iii) the amount you shifted each row in your array (iv) the contents of the hash table, (v) the parameters used to calculate the location of the key 64 and (vi) the parameters used to calculate the location of the key 36.
keys (input in this order): 5 16 64 39 28 3 22 9 33 7 31 45 Use t = 9
Explanation / Answer
public class Hashtable{ private static final int SIZE = 97; private Pair[] map = null; public Hashtable(){ this(SIZE); } public Hashtable(int N){ map = new Pair[N]; for(int i =0; iRelated Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.