Time complexity of dictionary insertions

Oliver Ciupke ciupke at fzi.de
Thu Apr 22 09:16:21 EDT 1999


As I understood from the Python documentation, dictionaries are
implemented as
extensible hash tables. What I didn't find either in the references or
in the FAQ is: what is the
actual time complexity for an insertion into a dictionary?

Do the old contents (probably references) have to be copied when
extending (doubling?) the
dictionary?

I guess updates and deletions have constand complexity, right?

If the complexity of insertion is something like n*log(n), does anyone
know measurements "how
linear" the real measured times are?


Thanks in advance
--Oliver







More information about the Python-list mailing list