#pragma once #include #include #include std::uint64_t hash(std::string const& s); class Hash_Table { public: Hash_Table(); void insert(std::string const& key, int value); void remove(std::string const& key); int& lookup(std::string const& key); bool contains(std::string const& key) const; std::vector keys() const; private: unsigned find(std::string const& key) const; void resize(unsigned new_size); private: struct Entry { std::string key { }; int value { }; bool valid { }; }; std::vector table; };