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

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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Algorithms Questions!