Err, that line of reasoning is flawed.

O (2n) [or, if you prefer, 2 * O (n)] is conceptually equal to O (n);  
neither are the same as O (n^2).  Iterating through a loop twice (e.g.  
two loops in series) is still linear, not exponential.


On Sep 16, 2008, at 10:30 AM, Mark Holton wrote:

> I agree with you, Simon.  The solutions that iterate over the loop  
> 2x have poorer BigO than the grep method.  That is, as the array  
> size increases, the two iterations are O(N^2), while the grep method  
> is more on the order of O(N).

You received this message because you are subscribed to the Google Groups 
"Prototype: Core" group.
To post to this group, send email to
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at

Reply via email to