how to delete multiple elements from a list

Rainer Deyke root at rainerdeyke.com
Thu Nov 16 01:26:23 CET 2000


"Alex Martelli" <aleaxit at yahoo.com> wrote in message
news:8uuunt015s3 at news1.newsguy.com...
> The reallocation costs are amortized by rounding up the
> size (number of items) to a multiple of 10 (of 100, for
> large lists), but that doesn't change the O(N) cost of
> element insertions and deletions (it does change the
> amortized costs by a constant factor of 10, or 100).

I'm curious.  Why multiples of 10 (or 100), and not powers of 2 (or
similar)?  The latter has much better amortized performance for huge lists,
and never wastes more than half of its space.


--
Rainer Deyke (root at rainerdeyke.com)
Shareware computer games           -           http://rainerdeyke.com
"In ihren Reihen zu stehen heisst unter Feinden zu kaempfen" - Abigor





More information about the Python-list mailing list