Question
C++ I need help writing the functions for this hash table class. All I need is the hash function(I already wrote something in this function
C++ I need help writing the functions for this hash table class. All I need is the hash function(I already wrote something in this function but not sure if it correct), insert function, lookup function(search), and probeFunction. Eveything else you can keep blank unlest somehow they associate with one another. Thanks. ____________________________________________________________________________________________________________________________________________________
#include
bool remove(string key, int value); bool lookup(string key, int& value); // Lookup a key in hash table. Copies value to value if found and returns true, returns false if key not in table. void getKeys(string*& all_keys, int& nkeys); // Return an array of all the keys in the table. Stores these nkeys in array keys. int numStored(); // Return the number of (key,value) pairs currently in the table. Phonedirectory(); // Create a default sized hash table. Phonedirectory(int nkeys); // Create a hash table that can store nkeys keys (allocates 4x space). ~Phonedirectory(); void printTable(); // Print the contents of the hash table data structures, useful for debugging.
}
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