3 ms·
if the initial array is going to be of fixed size, why not: typedef struct HashTable { Entry *buckets[4]; int nBuckets; } HashTable; w
by zabzonk 3y ago
if the initial array is going to be of fixed size, why not:
typedef struct HashTable {
Entry *buckets[4];
int nBuckets;
} HashTable;
which removes one layer of dynamic memory management.
- the-smug-one 3y ago>resize the buckets array once it gets too full Because of that, basically.
- zabzonk 3y agoi don't see where in his code this is done. possibly me being stupid.
- the-smug-one 3y agoOh sorry, it's from "future improvements" :), I assumed that was the train of thought. You're entirely correct, however.