Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void _setTableSize(struct hashMap * ht, int newTableSize)
- {
- /*write this*/
- /* Group 30: Worksheet 38, resizeTable */
- /* get the old size */
- int oldSize = ht->tableSize;
- struct hashLink **old = ht->table;
- /* make the pointers */
- hashLink *cur;
- hashLink *last;
- /* make the hashMap */
- _initMap(ht, newTableSize);
- for(int i = 0; i < oldSize; i++){
- cur = ht->old[i];
- while(cur != 0){
- insertMap(ht, cur->key, cur->value);
- last = cur;
- cur = cur->next;
- free(last);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement