Multiple choice softskills creativity

how will u find Prime No below N<=10^6 within 2 sec whereas the Processor speed is low , Ram capacity is also limited..

  1. sieve of Atkin

  2. Cheacking each number wherther it is prime or not

  3. Eratosthenes Sieve

  4. none of the above

Reveal answer Fill a bubble to check yourself
A,C Correct answer
Explanation

Both Sieve of Atkin and Eratosthenes Sieve efficiently generate all primes up to N using O(N log log N) time complexity. Eratosthenes works by iteratively marking multiples of each prime starting from 2, while Atkin uses quadratic forms to sieve composites. Both algorithms easily handle N=10^6 within 2 seconds even on modest hardware. Option B is inefficient (O(N*sqrt(N))) and would exceed the time limit.