The REALLY bad thing about Python lists ..

Michael Hudson mwh21 at cam.ac.uk
Sun May 14 15:26:29 EDT 2000


rturpin at my-deja.com writes:

> > .. this is still n^2, I guess, ..
> 
> You guess wrong.  Creating an array by appending
> at the end is linear in the length of the array.

Only if you know the length of the array in advance, surely?  I know
why this doesn't really apply to Python, but I was being theoretical.

Cheers,
M.

-- 
48. The best book on programming for the layman is "Alice in
    Wonderland";  but  that's because it's  the best book on 
    anything for the layman.
     -- Alan Perlis, http://www.cs.yale.edu/~perlis-alan/quotes.html



More information about the Python-list mailing list