SING C++, IN VISUAL STUDIOS, I NEED HELP WITH THIS. template class Dictionary (friend class UnitTests Lab5,// Giving access to test code struct Pair (Key key. Value value; Pair(const Key& key, const Value& value) { // TODO: Implement this method key = key; value = value; } // For testing bool operator = = (const Pair& comp) const { return ( comp.key = = key && comp.value == value);]]; // Data members // NOTE: All values set to -1 for unit test purposes std::list mTable = reinterpret cast">(-1); // A dynamic array of lists (these are the buckets) size_t mNumBuckets=1; // Number of elements in mlable unsigned int("mHashFunc) (const Key&) = reinterpret cast(-1); // Pointer to the hash function public: Dictionary(size_t_numBuckets, unsigned int ("_hashFunc) (const Key&)) // TODO: Implement this method ) --Dictionary (// TODO: Implement this method] Dictionary(const Dictionary& copy) { // TODO: Implement this method) Dictionary& operator= (const Dictionary& assign) { // TODO: Implement this method } void Clear() { // TODO: Implement this method) void insert(const Key& key, const Value& value) (//TODO: Implement this method } const Value" Find(const Key& key) { // TODO: Implement this method) bool Remove(const Key&_key) { // TODO: Implement this method ) );Data Members Pair key value Dictionary miable mNumBuckets miHashFunc mHashFunc Methods The key that is used to determine the pair's position in the table The value that is associated with the key A dynamic array of lists that store pairs. Each index of this array is a single list, and will be referred to throughout as a bucket. The number of elements in the table A pointer to the hash function This function will always retum a valid index to the table Pair Constructor Assign the members to the values passed in Dictionary Constructor Dynamically allocate the table, based on the supplied number of buckets Look at the type of pointer the table is if you are having problems Assign your other data members to the passed-in values Destructor Cleans up all dynamically allocated memory You do not need to remove the data from each individual list Clear Empty all of the data from each bucket Do not delete the table or reset any of the data members
USING C++, IN VISUAL STUDIOS, I NEED HELP WITH THIS. template class Dictionary (friend class UnitTests Lab5,// Giving access to test code struct Pair (Key key. Value value; Pair(const Key& key, const Value& value) { // TODO: Implement this method key = key; value = value; } // For testing bool operator = = (const Pair& comp) const { return ( comp.key = = key && comp.value == value);]]; // Data members // NOTE: All values set to -1 for unit test purposes std::list mTable = reinterpret cast">(-1); // A dynamic array of lists (these are the buckets) size_t mNumBuckets=1; // Number of elements in mlable unsigned int("mHashFunc) (const Key&) = reinterpret cast(-1); // Pointer to the hash function public: Dictionary(size_t_numBuckets, unsigned int ("_hashFunc) (const Key&)) // TODO: Implement this method ) --Dictionary (// TODO: Implement this method] Dictionary(const Dictionary& copy) { // TODO: Implement this method) Dictionary& operator= (const Dictionary& assign) { // TODO: Implement this method } void Clear() { // TODO: Implement this method) void insert(const Key& key, const Value& value) (//TODO: Implement this method } const Value" Find(const Key& key) { // TODO: Implement this method) bool Remove(const Key&_key) { // TODO: Implement this method ) );Data Members Pair key value Dictionary miable mNumBuckets miHashFunc mHashFunc Methods The key that is used to determine the pair's position in the table The value that is associated with the key A dynamic array of lists that store pairs. Each index of this array is a single list, and will be referred to throughout as a bucket. The number of elements in the table A pointer to the hash function This function will always retum a valid index to the table Pair Constructor Assign the members to the values passed in Dictionary Constructor Dynamically allocate the table, based on the supplied number of buckets Look at the type of pointer the table is if you are having problems Assign your other data members to the passed-in values Destructor Cleans up all dynamically allocated memory You do not need to remove the data from each individual list Clear Empty all of the data from each bucket Do not delete the table or reset any of the data members
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 1 images