3 ms·
So the typical sieve of Eratosthenes is O(N log log N). Perhaps surprisingly, you can actually write a sieve that's O(N).
by chillee 8y ago
So the typical sieve of Eratosthenes is O(N log log N). Perhaps surprisingly, you can actually write a sieve that's O(N).