R: unique items in lists

Bob Cannard bob_cannard at mentor.com
Wed Mar 28 13:10:21 EST 2001


Remco Gerlich wrote:
> Dictionaries are hashes, I'm assuming a dictionary setattr is about constant
> time. The "dict.keys()" at the end must be linear, since its result is
> linear...

Looking back over the messages, it seems that I misread Remco's earlier
message - for some reason I read it as meaning the dictionary lookups
were linear, which would certainly be bad news! Oh well. At least
my analysis of the original algorithm appears to be correct.

Moral: never post while suffering from caffeine deficiency.

Cheers,

        Bob.



More information about the Python-list mailing list