debbynirwan / hash_table

Simple implementation of Hash Table in C++. It's mainly intended to show how hash tables are implemented by libraries like STL.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

hash_table

Simple implementation of Hash Table in C++. It's mainly intended to show how hash tables are implemented by libraries like STL.

How to build and install the library

It is a header-only library. You can copy it directly into your repository or build and install it as follows:

> mkdir build && cd build
> cmake ..
> make
> make install

To build the example you have to set the BUILD_EXAMPLE option ON. By default it is not built.

> cmake -DBUILD_EXAMPLE=ON ..

Examples

To use the library simply include and use it.

#include "hash_table.hpp"

HashTable<int, int> table;

table.Insert(1, 5);
auto val = table.At(1);
table.Remove(1);

see example for more.

Documentation

If you're interested in understanding the details you can read my blog post here.

Issues

Please report issues if you found bugs or raise a Pull Request.

About

Simple implementation of Hash Table in C++. It's mainly intended to show how hash tables are implemented by libraries like STL.

License:Apache License 2.0


Languages

Language:C++ 71.9%Language:Python 21.6%Language:CMake 6.0%Language:Shell 0.4%