4 ms·
Generally it's easier if the height of a hash table is a fixed value (which can be calculated once at runtime based on how much memory the table can consume) so
by snorkel 12y ago
Generally it's easier if the height of a hash table is a fixed value (which can be calculated once at runtime based on how much memory the table can consume) so that the hashing logic is:
target_row_number = table_height % int_value_of_key
If table height keeps changing then this formula would be inconsistent. This code isn't using % but kind of doing the same using &