I'm having problem understanding why do we* use node as data-type?
*(I'm doing CS50 and while solving problem sets it's givel like this)
node *hashtable[50];
(here node refers to linked list node) as we are just storing an pointer for a linked list in it, wouldn't it be better to define it as just an array of char*
char *hashtable[50];
Hashing functions have collisions. When a key hashes to an index where the table is already occupied, one strategy to resolve the collisions have a linked list there and you simply append to it.
There are other collision resolution strategies, but the separate chaining strategy is probably the simplest.
In order to be able to treat the hash table items as linked lists, they need to have at least a next
pointer in addition to their payload. Hence the items need to be some kind of struct node*
rather than the payload type directly.