array, list, performance...

Michael Hudson mwh at python.net
Thu Jun 6 08:49:02 EDT 2002


gabor <gabor at realtime.sk> writes:

> hi,
> 
> how fast is list?
> 
> i mean accessing an item at an arbitrary position is O[n] or O[1]?

They are more like what tend to be called vectors in other languages,
in particular accessing an arbitrary element is O(1) (ignoring cache
effects and other little pesky details).

Cheers,
M.

-- 
  Gullible editorial staff continues to post links to any and all
  articles that vaguely criticize Linux in any way.
         -- Reason #4 for quitting slashdot today, from
            http://www.cs.washington.edu/homes/klee/misc/slashdot.html



More information about the Python-list mailing list