Skip to content

Latest commit

 

History

History
24 lines (18 loc) · 569 Bytes

README.md

File metadata and controls

24 lines (18 loc) · 569 Bytes

crobin

This is an implementation of a "string to int" hash table with Robin Hood hashing. It is kept ANSI C for simplicity.

Sample usage:

#include <stdio.h>
#include "robin_map.h"

int main() {
    robin_map map = rm_init();
    char* keys[] = {
        "hello", "world"
    };
    int sz = (int) sizeof keys / sizeof *keys;
    int i;

    for (i = 0; i != sz; ++i) rm_put(&map, keys[i], i);

    for (i = 0; i != sz; ++i) 
        printf("`%s` -> %d\n", keys[i], *rm_get(&map, keys[i]));
}