Home > algorithm > khash: A C hash library

khash: A C hash library

By attractive chaos

http://attractivechaos.wordpress.com/2009/09/29/khash-h/

The function of hash functions:

input -> function -> output

key -> kh_put -> iterator  (insert a key to hash table)

key-> kh_get -> iterator  (given a key, get it’s iterator)

iterator-> kh_val->value (given a iterator, get it’s value)

iterator-> kh_key->key (given a iterator, get it’s key)

iterator -> kh_exist -> 0/1 (exist a element or not)

iterator-> kh_del  (delete a element)

kh_begin -> iterator (the start iterator)

kh_end -> iterator (the end iterator)

kh_size -> int  (number of elements in hash table)

hash -> kh_destroy (destroy a hash table)

Categories: algorithm Tags: ,
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

%d