Counting primes. Compare Prime Sieve with the method that we used to demonstrate the break statement, at the end of Section 1.3. This is a classic example of a space–time tradeoff: Prime Sieve is fast, but requires a Boolean array of length n; the other approach uses only two integer variables, but is substantially slower. Estimate the magnitude of this difference by finding the value of n for which this second approach can complete the computation in about the same time as java Prime Seive 1000000.
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here