-
Notifications
You must be signed in to change notification settings - Fork 0
/
stringset.h
35 lines (26 loc) · 1.03 KB
/
stringset.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
//
// Created by Hasan Yusuf Ahmed on 11/19/17.
//
#ifndef STRINGSET_STRINGSET_H
#define STRINGSET_STRINGSET_H
#include "strll.h"
#define STRSET_DEFAULT 0
struct string_set{
unsigned int num_buckets; //the number of linked lists allocated
unsigned int num_elements; //the actual number of elements allocated
strll **strll_array; //array of nodes
float load_factor;
};
typedef struct string_set stringset;
stringset* stringset_new(unsigned int initial_size, float load_factor);
void stringset_free(stringset **str_set);
void stringset_add(stringset **str_set, char *str);
int stringset_remove(stringset **str_set, char* string);
int stringset_contains(stringset **str_set, char *str);
void stringset_rehash(stringset **str_set);
float stringset_load_value(stringset **str_set);
//int stringset_copy(stringset *dest, stringset *src);
//int stringset_deepcopy(stringset *dest, stringset *src);
void stringset_free_lite(stringset **str_set);
unsigned long hash_code(stringset **str_set, const char *str);
#endif //STRINGSET_STRINGSET_H