lists and sequences

Tim Peters tim.one at comcast.net
Tue Jun 11 19:32:25 EDT 2002


[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
alist.pop(0).

> What sorting algorithm is used by its sort member function?

A hybrid of samplesort and binary insertion sort.

> Are the answers to these questions the same for Jython?

Don't know.

grateful-for-the-easy-ones<wink>-ly y'rs  - tim






More information about the Python-list mailing list