ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> python-list
python-list
Re: Surprising (for me) benchmark results...
by Courageous other posts by this author
May 2 2001 12:15PM messages near this date
Re: curry and compose -- functional language constructs | Re: Surprising (for me) benchmark results...
> If you want to consider things that way then you have to worry
> about Python's list extension, which last I heard was O(N**2)...

NO.

list.append() appends items to a dynamic array in O(1)+k
constant amortized time. It does this by using a liberal preallocation
strategy, and leaving empty slots into which new elements can
be placed. The occasional realloc() amortizes away quite readily.

C//


-- 
http://mail.python.org/mailman/listinfo/python-list
Thread:
Courageous
Toby Dickenson
Alex Martelli
Courageous
Alex Martelli
Courageous
Daniel Berlin
Tim Peters

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved