Implementation of hash table with open addressing and linear probing for resolving collisions.
Warning: This class developed with using C++11 make sure your compiler supports this standard.
To work with the Hash table class just add the file hash_table.h
to your project.
For calculating hash value using multiplication method:
For resolving collisions using linear probing.
Class Hash table developed as template class with three parameters:
template <size_t S, typename K, typename T> class HashTable;
/*
S - size of the table
K - type of key
T - type of data
*/
Hash table can work with custom types. For this you need overloaded std::hash to your types. You can find example of overloading in struct_profile.h
and stuct_account.h
as well.
- MIT license
- Copyright 2019 © Smolyakov Alexander