lists and sequences
Dave Reed
dreed at capital.edu
Tue Jun 11 20:26:44 EDT 2002
> From: Tim Peters <tim.one at comcast.net>
> Cc: cmonahan at yahoo.com
>
> [Collin Monahan]
> > What is a python list? Is it a linked list or a random access structure
> > in contiguous memory?
>
> A contiguous vector of pointers to objects.
>
> > What type of situations should be avoided when using it?
>
> Depends on the app and your judgment of appropriate tradeoffs.
>
> > E.g. when does n^2 time happen using it?
>
> alist.insert(0, newthing) physically moves len(alist) elements. Ditto
Just to be clear, these are order n, not order n^2.
<other info snipped>
Dave
More information about the Python-list
mailing list