Question: Here is heapMap code: package hashMap; import java.util.*; import java.io.*; /eed to import more packages public class hashMap{ int m; //m size of the table

Here is heapMap code:
package hashMap; import java.util.*; import java.io.*; /eed to import more packages public class hashMap{ int m; //m size of the table int p; // prime m
[] hashtable; //Constructor. //Pick a universal hash function here and called readCSV() public hashMap(double alpha){ m= (int)(Math.ceil((n/alpha)))+1; m=Math.abs(m); @SuppressWarnings("unchecked") LinkedList[] table= new LinkedList[m]; hashtable=table; p=getPrime(m+1, 2*m-1); }// Complete this hashMap method. //return an index of the table public int universalHash(String key) { return 0; }//Complete universalHash method. Note return value is dummy. // insert would call universalHash public void insert(String key, String data) { }// Complete this insert method public String search(String key){ return "00"; }//complete the search method. Note return value is dummy //Return a prime number between [x,y] public int getPrime(int x, int y){ int p=4; while(isPrime(p)==false){ p=rand(x,y); } return p; } //First read the csv file and then insert data into the table. //This method should be called with the contructor. public void readCsv()throws FileNotFoundException,IOException{ }//complete the search method. //Locally called by getPrime() private boolean isPrime(int q){ int max=(int) Math.ceil(Math.sqrt(q)); for(int i=2; i -----------------------------------
package hashMap; public class hashNode{ String key; String data; hashNode next; //constructor public hashNode(String k, String d){ key=k; data=d; } }
---------------------
csvfile
Zip Code ZCTA,Population 1001,16769 1002,29049 1003,10372 1005,5079 1007,14649 1008,1263
In this problem, you have to implement (in java) a hash map and observe how different load factor impact the performance of hash data structure. Collisions must be resolved by separate chaining. You have been provided a data set for this task is a CSV file (zip- code.csv) with two columns, namely zipcode and population. * Your class should be called hashMap.java and must include the follow- ing methods. Universal hash function (the one we saw in the class). 2. int universalHash(String key): return the hash value of the key. Note keys are of type strings, thus they must be prehashed using the hashCode method for strings. table for a given ZIP code