#include using namespace std; // This is a bad hash function because it only returns 26 possible results int data_hash(string s){ return s[0]; } #include "hash_table.h" int main(){ HashTable test_table(16); test_table["Fox"] = 1; test_table["Goat"] = 10; test_table["Iguana"] = 400; test_table["Fish"] = 2; test_table["Ferret"] = 3; test_table["Kite"] = 20; test_table.debug_info(); test_table.remove("Fox"); if(test_table.contains("Fish")) cout << "Still have fish, good!\n"; else cout << "Fish went away when removing fox\n"; test_table.debug_info(); if(!test_table.contains("Fox")) cout << "Fox is gone\n"; else cout << "Retrieve fox test: " << test_table["Fox"] << endl; test_table.debug_info(); cout << "Contents: " << endl; for(auto &k : test_table) cout << k << ": " << test_table[k] << endl; // Double-ferret mystery return 0; }