4 ms·
Well it's closer to O((n/log(n))^0.5), although that doesn't make much of a difference until n becomes rather large.
by contravariant 10y ago
Well it's closer to O((n/log(n))^0.5), although that doesn't make much of a difference until n becomes rather large.
- mikejb 10y agoGood catch - I didn't differentiation between n as 'upper limit for primes' and n as 'input length'. The former is more intuitive, which makes your solution more accurate. (Also, I should have played it safe and use O instead of Θ...)