Answered step by step
Verified Expert Solution
Question
1 Approved Answer
C++ hashing problem -Please follow the intructions when making the functions -Please use the prime number 17011 for the size of your hashtable Database file:
C++ hashing problem
-Please follow the intructions when making the functions
-Please use the prime number 17011 for the size of your hashtable
Database file: Superhero Database
https://raw.githubusercontent.com/irawoodring/263/master/assignments/marvel-wikia-data.csv
For this project you are tasked with creating a hashmap class. It can be generic if you like (probably easier to write it that way), or you can write it specifically to house objects of type Superhero .A Superhero has the following fields int page_id; std::string name; std::string urlslug; std::string id; std::string alignment: char eye_color; char hair_color; char sex; std::string gsm; boolean alive; int appearances; std::string first appearance; int year; As per object oriented best practices all fields should be private Your hashmap class should hash based on the entire name of the superhero. You will use the separate chaining method to handle collisions (each array indice will correspond to a vector object where the data will be stored). Your hashmap will provide only the following public methods boolean insert (const Superhero & s); Superhero & get(const std::string name); The insert function returns either true or false depending on whether a collision occurred on insert. Regardless of whether a collision occurred or not the object should be inserted in the vector. Additionally, as we discussed in class, the object should be added to the front of the vector. For this project you are tasked with creating a hashmap class. It can be generic if you like (probably easier to write it that way), or you can write it specifically to house objects of type Superhero .A Superhero has the following fields int page_id; std::string name; std::string urlslug; std::string id; std::string alignment: char eye_color; char hair_color; char sex; std::string gsm; boolean alive; int appearances; std::string first appearance; int year; As per object oriented best practices all fields should be private Your hashmap class should hash based on the entire name of the superhero. You will use the separate chaining method to handle collisions (each array indice will correspond to a vector object where the data will be stored). Your hashmap will provide only the following public methods boolean insert (const Superhero & s); Superhero & get(const std::string name); The insert function returns either true or false depending on whether a collision occurred on insert. Regardless of whether a collision occurred or not the object should be inserted in the vector. Additionally, as we discussed in class, the object should be added to the front of the vector
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