Question: write the definition for the following functions in c++ format #ifndef HW_7_HASH_TABLE #define HW_7_HASH_TABLE #include #include // struct to store word + count combinations struct

write the definition for the following functions in c++ format

#ifndef HW_7_HASH_TABLE #define HW_7_HASH_TABLE #include #include

// struct to store word + count combinations

struct wordItem { std::string word; int count; wordItem* next; }; const int STOPWORD_LIST_SIZE = 50; class HashTable{ public: HashTable(int hashTableSize); ~HashTable(); void getStopWords(char *ignoreWordFileName); bool isStopWord(std::string word); bool isInTable(std::string word); void incrementCount(std::string word); void addWord(std::string word); int getTotalNumberNonStopWords(); void printTopN(int n); int getNumUniqueWords(); int getNumCollisions(); private: int getHash(std::string word); wordItem* searchTable(std::string word); int numUniqueWords; int numCollisions; int hashTableSize; wordItem** hashTable; std::vector vecIgnoreWords = std::vector(STOPWORD_LIST_SIZE);

}; #endif

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!