Source/Assg13/assg-13.cpp Source/Assg13/assg-13.cpp /** * * * @description Assignment 13 Dictionaries and Hash table * implementations. */ #include < cassert > #include < iostream > #include “KeyValuePair.hpp” #include “Employee.hpp” #include “HashDictionary.hpp” using namespace std ; /** main * The main entry point for this program. Execution of this program * will begin with this main function. * * @param argc The command line argument count which is the number of * command line arguments provided by user when they started * the program. * @param argv The command line arguments, an array of character * arrays. * * @returns An int value indicating program exit status. Usually 0 * is returned to indicate normal exit and a non-zero value * is returned to indicate an error condition. */ int main ( int argc , char ** argv ) { // ———————————————————————– cout << “—– testing Employee record and KeyValuePair class ———–” << endl ; KeyValuePair < int , string > pair ( 42 , “blue” ); cout << “test key: ” << pair . key () << endl ; assert ( pair . key () == 42 ); cout << “test value: ” << pair . value () << endl ; assert ( pair . value () == “blue” ); int id = 3 ; Employee e ( id , “Derek Harter” , “1234 Main Street, Commerce TX” , 12345.67 ); cout << e << endl ; assert ( e . getId () == 3 ); assert ( e . getName () == “Derek Harter” ); cout << endl ; // ———————————————————————– cout << “————– testing quadratic probing ———————–” << endl ; const int TABLE_SIZE = 7 ; HashDictionary < int , Employee > dict ( TABLE_SIZE , EMPTY_EMPLOYEE_ID ); cout << “Newly created hash dictionary should be empty, size: ” << dict . size () << endl ; assert ( dict . size () == 0 ); int probeIndex = 0 ; //cout << “probe index: ” << probeIndex // << ” returned probe value: ” << dict.probe(id, probeIndex) // << endl; //assert(dict.probe(id, probeIndex) == 2); probeIndex = 1 ; […]
Do you need a similar assignment done for you from scratch? Order now!
Use Discount Code "Newclient" for a 15% Discount!