Skip to content

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

License

Notifications You must be signed in to change notification settings

debbynirwan/hash_table

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

Topics

Resources

License

Stars

Watchers

Forks