¡@

Home 

java Programming Glossary: sieve

Most elegant way to generate prime numbers

http://stackoverflow.com/questions/1042902/most-elegant-way-to-generate-prime-numbers

inefficient. I don't mind which method is used naive or sieve or anything else but I do want it to be fairly short and obvious.. and Rekreativc A very clean implementation of the sieve of Eratosthenes starblue Use Java's BigInteger s and nextProbablePrime.. a decent method of finding the limit to provide to the sieves . c# java algorithm primes share improve this question ..

What would be the fastest method to test for primality in Java?

http://stackoverflow.com/questions/2385909/what-would-be-the-fastest-method-to-test-for-primality-in-java

2 representing all uneven numbers and used a prime sieve to find all primes in the range 1..Integer.MAX_VALUE . I then..

Boolean[] vs. BitSet: Which is more efficient?

http://stackoverflow.com/questions/605226/boolean-vs-bitset-which-is-more-efficient

some benchmarks with Sun JDK 1.6 computing primes with a sieve best of 10 iterations to warm up give the JIT compiler a chance..

Creating a memory leak with Java

http://stackoverflow.com/questions/6470651/creating-a-memory-leak-with-java

application containers like Tomcat can leak memory like sieve if you frequently redeploy applications that happen to use ThreadLocals..

Calculating and printing the nth prime number

http://stackoverflow.com/questions/9625663/calculating-and-printing-the-nth-prime-number

numbers less than N takes O N 1.5 log N ² steps. In the sieve each composite n is paired with all of its prime divisors but.. crossed off multiple times. One might believe that since a sieve contains many more 'expensive' numbers than 'cheap' ones it.. n is log log n so even the 'expensive' numbers in the sieve are on average no more or hardly more expensive than the 'cheap'..

Finding prime numbers with the Sieve of Eratosthenes (Originally: Is there a better way to prepare this array?)

http://stackoverflow.com/questions/586284/finding-prime-numbers-with-the-sieve-of-eratosthenes-originally-is-there-a-bet

prime numbers with the Sieve of Eratosthenes Originally Is there a better way to prepare.. way to prepare this array Note Version 2 below uses the Sieve of Eratosthenes. There are several answers that helped with.. helped with what I originally asked. I have chosen the Sieve of Eratosthenes method implemented it and changed the question..

Calculating and printing the nth prime number

http://stackoverflow.com/questions/9625663/calculating-and-printing-the-nth-prime-number

six minutes. Eliminating composites by prime divisors the Sieve of Eratosthenes Instead of investigating the numbers in sequence.. multiples of a given prime in one go. This is known as the Sieve of Eratosthenes To find the prime numbers not exceeding N make.. other types of prime sieves of particular interest is the Sieve of Atkin which exploits the fact that certain congruence classes..