31 Dec
2005
31 Dec
'05
10:45 p.m.
Hello, I thought about another reason to resize the hash table when it has too few elements. It's not only a matter of memory usage, it's also a matter of time usage: iteration over a set or a dict requires going over all the table. For example, iteration over a set which once had 1,000,000 members and now has 2 can take 1,000,000 operations every time you traverse all the (2) elements. Apologies: 1. It may be trivial to you - I'm sorry, I thought about it just now. 2. You can, of course, still do whatever tradeoff you like. Noam