Set data structure..

Lexy Zhitenev zhitenev at cs.vsu.ru
Wed Feb 19 15:02:23 CET 2003


"Alessio Pace" <puccio_13 at yahoo.it> wrote:
news:uSL4a.20711$uA5.509282 at tornado.fastwebnet.it...
> Hi, I am a python newbie, so this could be a silly question:
> I need a Set like data structure, I just see list and dictionary as
> built-in. Should I use one of those for my set purpose(I was thinking
about
> using a dictionary giving meaning only to the keys, but it seems a waste
of
> space for large inputs) and if so, which one has better access performance
> to check if an element is in the set? Thanks!

I can't think of specialized Set classes, but I don't think that you're
gonna use very large sets. Then, the dictionaries is what you might wish.
The lookup of the keys is far faster than from lists.

Lexy.






More information about the Python-list mailing list