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

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

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
Transcribed Image Text: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
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Knowledge Booster
Developing computer interface
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education