Algorithm Name
Sieve of eratosthenes
Programming Language
Go
Category
Number Theory
Difficulty Level
Easy (Beginner friendly)
Algorithm Description
The Sieve of Eratosthenes efficiently finds all prime numbers up to a given number n. It works by iteratively marking the multiples of each prime number as non-prime, leaving only the primes unmarked. This algorithm is useful in mathematics, cryptography, and competitive programming, where generating prime numbers quickly is often required, and it does so in O(n log log n) time with simple implementation.
References (Optional)
No response
Contribution Intent
Code of Conduct
Algorithm Name
Sieve of eratosthenes
Programming Language
Go
Category
Number Theory
Difficulty Level
Easy (Beginner friendly)
Algorithm Description
The Sieve of Eratosthenes efficiently finds all prime numbers up to a given number n. It works by iteratively marking the multiples of each prime number as non-prime, leaving only the primes unmarked. This algorithm is useful in mathematics, cryptography, and competitive programming, where generating prime numbers quickly is often required, and it does so in O(n log log n) time with simple implementation.
References (Optional)
No response
Contribution Intent
Code of Conduct