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
// 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
}; #endif
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
