Queues - Is Infinity all right?

Paul Rubin http
Sun Oct 5 10:35:05 EDT 2003


Peter Hansen <peter at engcorp.com> writes:
> Checking the source, Queue is implemented as a sophisticated wrapper
> around a standard Python list [].  That means adding an item is 
> amortized O(1), while removing one is O(n).

Why is removing one O(n)?  That should be easy to fix, if true.




More information about the Python-list mailing list