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-June/080427.html below:

[Python-Dev] Proposal: add odict to collections

[Python-Dev] Proposal: add odict to collections [Python-Dev] Proposal: add odict to collections"Martin v. Löwis" martin at v.loewis.de
Sun Jun 15 10:48:25 CEST 2008
> ... like your implementation. It is not too hard to get the delitem
> O(log n) compared to your O(n), see here:
> 
> http://codespeak.net/svn/user/arigo/hack/pyfuse/OrderedDict.py
> 
> So many people are implementing this kind of data type but do not really
> care about making as fast as it could be ... IMHO yet another reason to
> ship a usable implementation with Python.

If you use a linked list instead of Python list, you can even do
deletion in O(1). Of course, memory consumption will be higher.

Regards,
Martin
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