bambam <[EMAIL PROTECTED]> wrote:

> > O(n) to find the element you wish to remove and move over
> > everything after it,
> 
> Is that how lists are stored in cPython? It seems unlikely?

So-called "lists" in Python are stored contiguously in memory (more like
"vectors" in some other languages), so e.g. L[n] is O(1) [independent
from n] but removing an element is O(N) [as all following items need to
be shifted 1 place down].


Alex
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to