![]() ![]() In other words, a prime number doesn't have a factor other than 1 or itself. You can see they are not divisible to any positive whole integer. If you don't remember, a prime number is a whole number that is either divisible by 1 or itself like 2, 3, and 5. He was the first man to calculate the circumference of the earth and also known for working on calendars with leap years. Sieve of Eratosthenes is an ancient Greek algorithm to find all prime numbers up to a given number and named after the famous Greek mathematician Eratosthenes. ![]() Surprisingly, not many developers know about this algorithm, particularly Java programmers, which is mainly because of not doing enough competitive programming. There are many occasions when you need to generate all prime numbers up to a specified integer and one algorithm which is most often used to generate prime numbers is the Sieve of Eratosthenes Algorithm. To continue the tradition, I am going to share an interesting algorithm today, The Sieve of Eratosthenes algorithm, which can be used to generate prime numbers up to a given number. Hello guys, I have said many times that a good knowledge of Data Structure and Algorithms is the first step towards becoming a better programmer and that's why I share a lot of Data structure and Algorithm stuff in this blog. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
March 2023
Categories |