Joenell's Posts
Nairaland Forum › Joenell's Profile › Joenell's Posts
1 (of 1 pages)
Please Guys out there, I need help on the below java programming question that I have been finding difficult to solve for some weeks now! And the question is: The sieve of Eratosthenes can be used to determine all prime less than a given integer, n. The methods can be described as follows; A. Store 1s in element p(1) to p(n) of an array B. Set f to 2 C. Set to 0 any element of p whose subscript is a multiple of p D. Set f to the subscript of the next element of p which contain 1 E. Repeat steps C and D until f reaches or equals the square root of n. The subscripts of those elements containing 1s are prime numbers. |
1 (of 1 pages)