Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void Insert(int x, hash_t* hashtable) {
- list* list;
- int hashval = hash(x, a, b, hashtable->size);
- list = malloc(sizeof(list)); // Allocate memory for the list
- list->value = x;
- if (list == NULL) {
- hashtable->table[hashval]->next = list;
- list = hashtable->table[hashval];
- }
- else {
- struct _list* index;
- for (index = list; index->next!=NULL; index= index->next) {
- }
- index->next = list;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment