Which is faster?

Fredrik Lundh fredrik at pythonware.com
Sat Aug 30 13:21:58 EDT 2008


Lie wrote:

>> how does doing something twice not change complexity? yes it maybe
>> belongs to the same complexity-class but is still twice as slow no?
> 
> Who is doing something twice? Definitely not sum().

nobody's claiming that -- but as mentioned above, even if sum() had done 
two passes over the source sequence, it'd still be O(n).

</F>




More information about the Python-list mailing list