data structures - How do I keep load factor small in my hash table? -


i'm learning hash tables , quadratic probing in particular. i've read if load factor <= 0.5 , table's size prime, quadratic probing find empty slot , no key accessed multiple times. goes on that, in order ensure efficient insertions, should maintain load factor <= 0.5. mean? surely if keep adding items, load factor increase until equals 1 whether want or not. implied when textbook says should maintain small load factor?

the implication @ point (when exceed load factor of 0.5 in case), you'll have allocate new table (which bigger factor, maybe 1.5 or 2, , rounded nearest prime number) , copy elements old table (that's not straight copy, new position of item different old position).


Comments

Popular posts from this blog

angularjs - ADAL JS Angular- WebAPI add a new role claim to the token -

php - CakePHP HttpSockets send array of paramms -

node.js - Using Node without global install -