summaryrefslogtreecommitdiff
path: root/src/02/04/hash.h
blob: b87f06c642b4e7bad846f2a66b4a57d1e9f8a0f9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
typedef struct node {
  struct node *next;
  int data;
} Node;

typedef struct {
  Node buckets[13];
  int size;
} Hash;

Hash *hash_init(int size);
int hash_get(Hash *hash, int key);
void hash_set(Hash *hash, int key, int value);