The Joys of Hashing: Hash Table Programming with C by Thomas Mailund

The Joys of Hashing: Hash Table Programming with C by Thomas Mailund

Author:Thomas Mailund [Thomas Mailund]
Language: eng
Format: epub, pdf
Publisher: Apress
Published: 2019-02-08T22:00:00+00:00


subtable *old_tables = table->tables;

subtable *new_tables = malloc(new_no_tables * sizeof(subtable));

for (uint32_t i = 0; i < new_no_tables; ++i) {

new_tables[i] = old_tables[i];

}

for (uint32_t i = new_no_tables; i < 2*new_no_tables; ++i) {

subtable subtab = table->tables[i];

free(subtab);

}

free(old_tables);

table->tables = new_tables;

table->allocated_tables = new_no_tables;

// When we shrink, all lists in the old tables

// must have been initialised

table->max_bin_initialised = size * new_no_tables;

}



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.