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
6
typedef
struct
7
{
8
unsigned
capacity;
9
unsigned
length;
10
void
**values;
11
void
**keys;
12
}
hash_set_t
;
13
14
extern
hash_set_t
*init_hash_set();
15
16
extern
unsigned
add(
hash_set_t
*
set
,
void
*value);
17
18
unsigned
put(
hash_set_t
*
set
,
long
long
hash,
void
*value);
19
20
extern
int
contains(
hash_set_t
*
set
,
void
*value);
21
22
int
contains_hash(
hash_set_t
*
set
,
long
long
hash);
23
24
extern
void
delete
(
hash_set_t
*
set
,
void
*value);
25
26
extern
long
long
hash(
void
*value);
27
28
extern
unsigned
retrieve_index_from_hash(
const
long
long
hash,
29
const
unsigned
capacity);
30
31
extern
void
resize(
hash_set_t
*
set
);
32
33
#endif
hash_set_t
Definition
hash_set.h:7
set
void set(Vector *vec, int index, int val)
This function sets an item at the specified index of the Vector.
Definition
vector.c:91
data_structures
hash_set
hash_set.h
Generated by
1.9.8