A RetroSearch Logo

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

Search Query:

Showing content from http://mail.python.org/pipermail/python-dev/2005-December/059238.html below:

[Python-Dev] When do sets shrink?

[Python-Dev] When do sets shrink? [Python-Dev] When do sets shrink?"Martin v. Löwis" martin at v.loewis.de
Thu Dec 29 01:36:45 CET 2005
Noam Raphael wrote:
> The computer scientist in me prefers O() terms over changes in a
> constant factor, but that's only me.

That remark, I don't understand. In a hash table, most "simple"
operations are O(n) as the worst-case time, except for operations
that may cause resizing, which are O(n**2) (worst case).

So you are proposing that .pop() might trigger a resize, thus
changing from O(n) worst case to O(n**2) worst case? Why would
a computer scientist prefer that?

> Perhaps a note about it should be added to the documentation, though?

Sure. Patches (to sf.net/projects/python) are welcome.

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