item access time: sets v. lists

Paul McGuire ptmcg at austin.rr._bogus_.com
Wed Oct 4 15:17:05 EDT 2006


"Duncan Booth" <duncan.booth at invalid.invalid> wrote in message 
news:Xns9852CB4F1A5A5duncanbooth at 127.0.0.1...
> "Paul McGuire" <ptmcg at austin.rr._bogus_.com> wrote:
>
>> By contrast, a set (and also the keys in a dict) use a tree structure
>> to index more quickly into the list of items
>
> 'dict' and I believe also 'set' use a hash table, not a tree structure.

Thanks, I stand corrected.  How do they know how big a hash table to use?  I 
think this is an interesting problem.

-- Paul





More information about the Python-list mailing list