Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Here is data from sample csv file: The code should work with any num data from csv file. Zip Code ZCTA,Population 1001,16769 1002,29049 1003,10372 1005,5079
Here is data from sample csv file: The code should work with any num data from csv file.
Zip Code ZCTA,Population
1001,16769
1002,29049
1003,10372
1005,5079
1007,14649
1008,1263
1009,741
1010,3609
1011,1370
1012,661
1013,23188
1020,29668
3. [Hashing, 40 pts] In this problem, you have to implement (in java) a hash table and test 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. You have to run the prograrn for load factor = 0.85, = 0.80. 0.75, 0.70, and = 0.65, = 0.60. Note the number of keys for this problem are fixed (see the data file). Therefore the table size is determined by the load factor Your class should be called hash.java and must include the following functions 1. int hash(String key): insert keys using universal hashing. Note keys are of type strings, thus they must be prehashed using the 2. void insert(String key, String data) new entries in the table using 3. String search(String key): return the population from the hash hashCode method for strings Universal hash function( the one we saw in the class) table for a given ZIP code using the ZIP codes as keys 4. Read the CSV file and insert all the entries into the hash table 5. double average length(): Return the average length of the linkedlists 6. double average collision(): return the average number of coli sions 7. Plot the average number of collisions vs load factor Java the command LinkedListStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started