Question
I need help! You will read the contributor information from a file provided; it is a comma delimited (CSV) file. As each record is read,
I need help! You will read the contributor information from a file provided; it is a comma delimited (CSV) file. As each record is read, create a Hash table for the ID field. The limitation for the Hash table is that it has a size of 5, so you need to be able to handle collisions. Collisions should be resolved through the use of a linked list for the ID values (implement this using a stack). Your design should include the following:
A Hash table pointing to a structure for a linked list that contains only the following information:
Each Hash Bucket Collision Item will have the following Information:
ID: Integer; //identifier key for future needs
Hash Bucket Functions/Methods:
Input constructor: //to accept a string for the name and additional information for each contributor (you will only need the ID portion of the input data)
Hash Function constructor: (Hint: You only have 5 Hash buckets, so the function can be a very simple calculation.)
Pop constructor
Push constructor
Print constructor: //to show the contents of a Hash bucket
Csv. file contents
Tim | Murphy | USA | 8285557865 | 200 | 25 |
Gordon | Miner | USA | 8285551008 | 150 | 32 |
Jean | Bell | USA | 8285557503 | 225 | 33 |
Mike | Prather | USA | 8285558497 | 155 | 34 |
George | Pipps | USA | 8285557777 | 100 | 35 |
Step 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