array, list, performance...

Michael Chermside mcherm at destiny.com
Thu Jun 6 17:42:05 CEST 2002


Oops, yes.

What I SHOULD have said was:
    li[n] = x   assignment to the middle is O(1)
    li[n:n] = x   INSERTION in the middle is O(len(li))

-- Michael Chermside


Christopher Armstrong wrote:
>>Michael Chermside <mcherm at destiny.com> writes::
>>  li[n] = x      assignment to the middle is O(len(li))
> 
> 
> This doesn't seem right. Shouldn't that be O(1), just like
> access-time?
> 







More information about the Python-list mailing list