Algorithms_in_C 1.0.0
Set of algorithms implemented in C.
Loading...
Searching...
No Matches
hash_set.h
1#ifndef __HASH_SET__
2#define __HASH_SET__
3
4#define DEFAULT_HASH_SET_CAPACITY 1 << 10
5
6typedef struct
7{
8 unsigned capacity;
9 unsigned length;
10 void **values;
11 void **keys;
13
14extern hash_set_t *init_hash_set();
15
16extern unsigned add(hash_set_t *set, void *value);
17
18unsigned put(hash_set_t *set, long long hash, void *value);
19
20extern int contains(hash_set_t *set, void *value);
21
22int contains_hash(hash_set_t *set, long long hash);
23
24extern void delete (hash_set_t *set, void *value);
25
26extern long long hash(void *value);
27
28extern unsigned retrieve_index_from_hash(const long long hash,
29 const unsigned capacity);
30
31extern void resize(hash_set_t *set);
32
33#endif
Definition hash_set.h:7
void set(Vector *vec, int index, int val)
This function sets an item at the specified index of the Vector.
Definition vector.c:91