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
![Data Members
Pair
key
value
Dictionary
mTable
mNumBuckets
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 return 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
o 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
o 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](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F9fadbb1b-35da-411d-a96f-f1ca2485a97d%2Fdd5562a1-9ddf-45c5-bb18-4f047f06e4ec%2Fh4d7r6v_processed.png&w=3840&q=75)
![](/static/compass_v2/shared-icons/check-mark.png)
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 1 images
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
![Database System Concepts](https://www.bartleby.com/isbn_cover_images/9780078022159/9780078022159_smallCoverImage.jpg)
![Starting Out with Python (4th Edition)](https://www.bartleby.com/isbn_cover_images/9780134444321/9780134444321_smallCoverImage.gif)
![Digital Fundamentals (11th Edition)](https://www.bartleby.com/isbn_cover_images/9780132737968/9780132737968_smallCoverImage.gif)
![Database System Concepts](https://www.bartleby.com/isbn_cover_images/9780078022159/9780078022159_smallCoverImage.jpg)
![Starting Out with Python (4th Edition)](https://www.bartleby.com/isbn_cover_images/9780134444321/9780134444321_smallCoverImage.gif)
![Digital Fundamentals (11th Edition)](https://www.bartleby.com/isbn_cover_images/9780132737968/9780132737968_smallCoverImage.gif)
![C How to Program (8th Edition)](https://www.bartleby.com/isbn_cover_images/9780133976892/9780133976892_smallCoverImage.gif)
![Database Systems: Design, Implementation, & Manag…](https://www.bartleby.com/isbn_cover_images/9781337627900/9781337627900_smallCoverImage.gif)
![Programmable Logic Controllers](https://www.bartleby.com/isbn_cover_images/9780073373843/9780073373843_smallCoverImage.gif)