Defensive programming

Anders J. Munch andersjm at
Mon Jun 2 10:19:34 CEST 2003

"Tim Peters" < at> wrote:
> Sure.  All dict implementations (hash tables) have O(N**2) worst-case
> behavior, over a sequence of N inserts and/or lookups, provoked by a
> sufficiently nasty set of N keys.

A hash table with balanced binary tree collision resolution has 
O(N logN) worst case.  Not that I see any way of using that for Python

- Anders

More information about the Python-list mailing list