Archive
Archive for the ‘algorithm’ Category
jsw’s home
2010/01/12
Leave a comment
Julienne Walker’s page, including some tutorials and libraries for data structures and algorithms (C)
Categories: algorithm, programming
algorithm
khash: A C hash library
2010/01/12
Leave a comment
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)
Recent Comments