You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We need some hash map utilities. Probably have the keys be const char *s and the values be void *. Here is a suggested API:
Creating and destroying: int hm_init(Hashmap *hm, int num_buckets); int hm_free(Hashmap *hm);
Looking up and setting values: void* hm_lookup(Hashmap *hm, const char* key); int hm_set(Hashmap *hm, const char *key, void *value);
Alter this as you see fit, as long as we can use const char* keys to access void* values and it mostly runs in O(1).
The text was updated successfully, but these errors were encountered:
We need some hash map utilities. Probably have the keys be
const char *
s and the values bevoid *
. Here is a suggested API:Creating and destroying:
int hm_init(Hashmap *hm, int num_buckets);
int hm_free(Hashmap *hm);
Looking up and setting values:
void* hm_lookup(Hashmap *hm, const char* key);
int hm_set(Hashmap *hm, const char *key, void *value);
Alter this as you see fit, as long as we can use
const char*
keys to accessvoid*
values and it mostly runs in O(1).The text was updated successfully, but these errors were encountered: