operation complexities of lists and dictionaries
bignose+hates-spam at benfinney.id.au
Thu Mar 30 01:01:10 CEST 2006
"xarnaudx at gmail.com" <xarnaudx at gmail.com> writes:
> what are the time complexities of inserting / removing / checking if an
> element is present in 1) a list and 2) a dictionary?
Partly dependent on the implementation, of which there are several for
Python (CPython, Jython, PyPy, and others). Which one are you most
> does anybody know?
The 'timeit' module can help you discover the answers for yourself, on
your current implementation.
\ "You could augment an earwig to the point where it understood |
`\ nuclear physics, but it would still be a very stupid thing to |
_o__) do!" -- The Doctor, _The Two Doctors_ |
More information about the Python-list