The REALLY bad thing about Python lists ..

Mike Coffin mhc at Eng.Sun.COM
Sun May 14 22:19:52 CEST 2000


Michael Hudson <mwh21 at cam.ac.uk> writes:

> So create it by appending n elements and then reverse it... this is
> still n^2, I guess, but for the numbers you can deal with before the
> universe dies a heat death, this will be vastly quicker than anything
> else you can do in Python.

Reversing a list is not N^2, it's linear in N.

-mike



More information about the Python-list mailing list