Re: Which is faster?



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>

.



Relevant Pages

  • Re: OOP/OOD Philosophy
    ... access will be duplicatied and the report twice as slow. ... But if the sum is printed in the footer of the report, ... important that the sum is the sum of the printed items and nothing ...
    (comp.object)
  • Re: Which is faster?
    ... belongs to the same complexity-class but is still twice as slow no? ... Who is doing something twice? ... sum() does not create intermediate list, ...
    (comp.lang.python)
  • Re: adding colums to text
    ... Bill Cunningham wrote: ... I am trying to create a moving average of data. ... asked at least twice, if only indirectly. ... number from the corresponding input line, followed by the sum of all ...
    (comp.lang.c)
  • Re: adding colums to text
    ... Bill Cunningham wrote: ... I am trying to create a moving average of data. ... asked at least twice, if only indirectly. ... number from the corresponding input line, followed by the sum of all ...
    (comp.lang.c)
  • Re: My Election Odds for MZB
    ... My mistake was in only offering to match the sum of the bet. ... I will now offer TWICE the ... amount if Bob T. stiffs Irish Mike. ...
    (rec.gambling.poker)