Question: c++ help - hashing and phonedirectory -- dynamic array of numbers and names -- impelemnt these functions .. specially the probe func, hashing, insert, search,
c++ help - hashing and phonedirectory --
dynamic array of numbers and names
--
impelemnt these functions .. specially the probe func, hashing, insert, search, silly hashing.
----------------
#include
using namespace std;
class Phonedirectory {
private:
int tsize, nstored, *value, *sentinels;
string *keys;
static const int curr_used = 1;
static const int never_used = 0;
static const int prev_used = -1;
static const int default_size = 10000;
int probeFunction(int val, int iter);
void init(int tsize);
int hash(string key);
int sillyHash(string key);
int smartHash(string key);
public:
bool insert(string key, int value);
bool remove(string key, int value);
bool lookup(string key, int &value);
bool modify(string key, int value);
void getKeys(string*& all_keys, int& nkeys);
int numStored();
Phonedirectory();
Phonedirectory(int nkeys);
~Phonedirectory();
void printTable();
};
int main(int argc, const char * argv[]) {
}
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
