5.4 Load Factor and Resizing
5.4 Load Factor and Resizing Problem As a hash table grows, collisions increase and operations slow down. If the table never expands, performance degrades toward linear time. If it expands too aggressively, memory is wasted and resizing costs dominate. You need a policy that keeps operations fast while controlling memory usage. Solution Track the load factor and resize the table when it crosses a threshold. load_factor = size / capacity...