Skip to content

Instantly share code, notes, and snippets.

View amir110's full-sized avatar

amir amir110

  • Tavana Afzar IT Dev.Co.
View GitHub Profile
@ssylvan
ssylvan / rh_hash_table.hpp
Last active January 12, 2023 04:52
Quick'n'dirty Robin Hood hash table implementation. Note, I have implemented this algorithm before, with tons of tests etc. But *this* code was written specifically for the blog post at http://sebastiansylvan.com/post/robin-hood-hashing-should-be-your-default-hash-table-implementation/, it has not been extensively tested so there may be bugs (an…
#define USE_ROBIN_HOOD_HASH 1
#define USE_SEPARATE_HASH_ARRAY 1
template<class Key, class Value>
class hash_table
{
static const int INITIAL_SIZE = 256;
static const int LOAD_FACTOR_PERCENT = 90;
struct elem