Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C++ hashing problem 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

C++ hashing problem

please use the prime number 17011 for the size of your hashtable

image text in transcribed

image text in transcribed

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

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 Design Query Formulation And Administration Using Oracle And PostgreSQL

Authors: Michael Mannino

8th Edition

1948426951, 978-1948426954

More Books

Students also viewed these Databases questions

Question

=+1. Why were participants randomly assigned to groups?

Answered: 1 week ago