overview
The Sieve of Eratosthenes algorithm iteratively marks the multiples of each prime number starting from 2, effectively identifying all prime numbers up to a specified limit.
usage
Primarily used for finding all prime numbers up to a given limit efficiently.
time complexity
O(n log log n), where n is the upper limit of the numbers to be checked for primality.
Space complexity
O(n), where n is the upper limit of the numbers to be checked for primality.