Question: for p for p 2 to n do A[p] 2 to n do if A[p] =0 j p* p while j < n do
![for p for p 2 to n do A[p] 2 to n](https://dsd5zvtm8ll6.cloudfront.net/questions/2024/02/65c5963543b5b_86165c596353eedb.jpg)
for p for p 2 to n do A[p] 2 to n do if A[p] =0 j p* p while j < n do A[j] 0 jj + p for p - 2 to n do if A[p] #0 //copy the remaining elements of A to array L of the primes i0 L[i] A[p] ii +1 p //see note before pseudocode //p hasn't been eliminated on previous passes return L //mark element as eliminated
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
