Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed

image text in transcribed

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

DATABASE Administrator Make A Difference

Authors: Mohciine Elmourabit

1st Edition

B0CGM7XG75, 978-1722657802

More Books

Students also viewed these Databases questions