#include using namespace std; template class MapNode{ public: string key; V value; MapNode *next; MapNode(string key, V value){ this->key = key; this->value = value; next = NULL; } ~MapNode(){ delete next; } }; template class mymap{ private: MapNode** buckets; int count; int numBuckets; int getBucketIndex(string key){ int hashcode = 0; int base = 1; int p = 37; for(int i=key.size()-1;i>=0;i--){ hashcode += key[i] * base; base = base * p; hashcode = hashcode%numBuckets; base = base%numBuckets; } return hashcode%numBuckets; } public: mymap(){ count = 0; numBuckets = 5; buckets = new MapNode*[numBuckets]; for(int i=0;i* head = buckets[bucketIndex]; while(head!=NULL){ if(head->key == key){ head->value = value; return; } head = head->next; } MapNode* node = new MapNode(key,value); node->next = buckets[bucketIndex]; buckets[bucketIndex] = node; count++; } V remove(string key){ } }; int main(){ return 0; }