Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please help!! This is written in code runner. Implement a C++ function to build a new hash table from an existing hash table using a

image text in transcribedimage text in transcribedimage text in transcribedPlease help!! This is written in code runner.

Implement a C++ function to build a new hash table from an existing hash table using a new hash function called hashSum2. In the new hash table, insert the movies at the front of the linked list when the movies hash to the same index. void HashTable::createNewHashTable();//You need to implement this function int hashSum2(std::string x, int s); createNewHashTable//already defined. You will need to call this function in struct Movie{std::string title; Movie *next; Movie(){}; Movie(std::string in_title){title = in_title; next = NULL;}}; class HashTable {public: HashTable(); ~HashTable(); void createNewHashTable(); private: int hashSum(std::string x, int tablesize); int hashSum2(std::string x, int s); int tableSize; Movie * hashTable[10]; Movie * newHashTable[10];};//Returns hashSum2 of input string x by summing every other letter in string int HashTable::hashSum2(string inputString, int hashLen) {int sum = 0; for (int i = 0; i Fight Club => The Matrix Index 1: The Lord of the Rings: The Fellowship of the Ring = > The Lord of the Rings: The Return of the Index 2: Schindler's List = > The Dark Knight = > The Godfather: Part II Index 3: The Good the Bad and the Ugly Index 4: 12 Angry Men Index 5: Pulp Fiction = > Shawshank Redemption Pulp Fiction => Shawshank Redemption Index 6: Index 7: The Godfather = > Inception Index 8: Index 9

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

Concepts of Database Management

Authors: Philip J. Pratt, Mary Z. Last

8th edition

ISBN: 1285427106, 978-1285427102

More Books

Students also viewed these Databases questions

Question

What is DDL?

Answered: 1 week ago