Implemented a simple hash table using the FNV-1a hashing algorithm. Not drawing routines for it yet, just the bare data structure.

This commit is contained in:
2022-11-03 22:46:00 -05:00
parent 420cf2ac12
commit 33dda8dffe
3 changed files with 138 additions and 0 deletions
+25
View File
@@ -0,0 +1,25 @@
#ifndef HASTABLE_H
#define HASTABLE_H
typedef struct {
char* Key;
char* Value;
} BucketKeyPair;
typedef struct {
unsigned int Size;
unsigned int Capacity;
BucketKeyPair** KeyPairs;
} Bucket;
typedef struct {
unsigned int Capacity;
Bucket** Values;
} HashTable;
HashTable* CreateHashTable(void);
void AddItemToHashTable(char* key, char* item, HashTable* table);
char* GetHashTableItem(char* key, HashTable* table);
void PrintHashTable(HashTable* table);
#endif