Load Factor and Resizing
The load factor measures how full a Hash Table is. For a table with n stored entries and m buckets, the load factor is alpha = n / m. As the load factor increases, collisions generally become more frequent, so implementations resize the table when a configured threshold is exceeded.
A lower load factor generally means fewer collisions but more memory usage.
A higher load factor improves memory efficiency but can increase lookup cost.
Resizing usually allocates a larger table.
Existing entries must be rehashed because bucket indexes depend on table capacity.
A resize operation itself can take O(n).
Over many insertions, resizing can still preserve amortized O(1) insertion.