What is the most efficient way to figure out if a number is prime for numbers from 2 up to 2,147,483,647 in Java? [closed]
Closed 14 hours ago.
What is the most efficient way to generate all prime number up to 2,147,483,647 in Java?
As Java programmers we can always use the BigInteger isProbablePrime() method or store manually all prime numbers in a HashMap. This question is about how we can generate prime numbers 1 to Integer.MAX_VALUE (2,147,483,647) efficiently using Data structures and custom Algorithms.
What is the most efficient way to generate all prime number up to 2,147,483,647 in Java?
As Java programmers we can always use the BigInteger isProbablePrime() method or store manually all prime numbers in a HashMap. This question is about how we can generate prime numbers 1 to Integer.MAX_VALUE (2,147,483,647) efficiently using Data structures and custom Algorithms.