-
Notifications
You must be signed in to change notification settings - Fork 0
/
hashTable.h
31 lines (25 loc) · 990 Bytes
/
hashTable.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
#ifndef GRAPH_C_HASHTABLE_H
#define GRAPH_C_HASHTABLE_H
#define ABS(x) (((x) >= (0)) ? (x) : (-(x)))
#include "arrayList.h"
/* ____________________________________________________________________________
Structures and Datatypes
____________________________________________________________________________
*/
typedef struct {
int size;
int itemSize;
int filledItems;
arrayList **array;
} hashTable;
/* ____________________________________________________________________________
Function Prototypes
____________________________________________________________________________
*/
hashTable *createHashTable(int size, int itemSize);
int hashTableAddElement(void *element, int id, hashTable *table);
int hashTableAddUncheckedElement(void *element, int index, hashTable *table);
void *hashTableGetElement(int id, hashTable *table);
void freeHashTable(hashTable **table);
int hashTableContains(int id, hashTable *table);
#endif