A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2008-March/077540.html below:

[Python-Dev] Complexity documentation request

[Python-Dev] Complexity documentation request [Python-Dev] Complexity documentation requestGreg Ewing greg.ewing at canterbury.ac.nz
Tue Mar 11 00:22:44 CET 2008
Dimitrios Apostolou wrote:

> On the other hand notes could be added for various oddities according to 
> experience. For example that for sets up to 10(?) elements, a list would 
> probably be better because of the hashing overhead.

That's the sort of thing that tends to be *very*
implementation dependent -- not just between CPython
and others, but between different releases of CPython.

> Hmmm, the first thing that comes to mind is prepending an item in a list 
> which is small and seems nice, but is O(n) I think!

Yeah, there's no substitute for having at least a
rough idea of how the object you're using is implemented,
e.g. array vs. linked list.

This kind of very basic information is something that
I think ought to be documented, and some guarantees
made in the language definition. For example, I think
a Python implementation that implemented lists as
linked lists would make many people unhappy, as their
algorithms suddenly went from O(n**m) to O(n**(m+1))
without anyone telling them.

-- 
Greg
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4