transforming a list into a string

Roy Smith roy at panix.com
Sat Jul 31 19:59:57 EDT 2004


Tim Peters <tim.peters at gmail.com> wrote:
> Lists and tuples and array.arrays are contiguous vectors, dicts are
> hash tables.  Everything follows from that in obvious ways -- but you
> already knew that.

OK, so it sounds like you want to reverse() the list before the loop, 
then pop() items off the back.  Two O(n) passes [I'm assuming reverse() 
is O(N)] beats O(n^2).



More information about the Python-list mailing list