Recall & Review
beginner Click to reveal answer
What is the main idea behind the Sieve of Eratosthenes?
It is a method to find all prime numbers up to a certain limit by repeatedly marking the multiples of each prime number starting from 2.
intermediate Click to reveal answer
Why do we start marking multiples from the square of the prime number in the Sieve of Eratosthenes?
Because all smaller multiples of that prime have already been marked by smaller primes, so starting from the square avoids redundant work.
beginner Click to reveal answer
In the Sieve of Eratosthenes, what does a 'true' value in the boolean array represent?
It means the number at that index is currently considered prime (not marked as a multiple of any smaller prime).
intermediate Click to reveal answer
What is the time complexity of the Sieve of Eratosthenes algorithm?
The time complexity is approximately O(n log log n), which is very efficient for finding primes up to n.
beginner Click to reveal answer
How does the Sieve of Eratosthenes help in real-life situations?
It helps quickly find prime numbers which are important in cryptography, hashing, and number theory problems.
What is the first prime number used in the Sieve of Eratosthenes?
✗ Incorrect
2 is the smallest prime number and the starting point for the sieve.
When marking multiples of a prime p, from which number do we start?
✗ Incorrect
We start from p squared because smaller multiples have been marked by smaller primes.
What data structure is commonly used to keep track of prime candidates in the sieve?
✗ Incorrect
A boolean array marks whether each number is prime (true) or not (false).
What happens to multiples of a prime number in the sieve?
✗ Incorrect
Multiples of primes are marked as non-prime to exclude them.
Which of these numbers will remain true (prime) after running the sieve up to 10?
✗ Incorrect
7 is prime; 4, 6, and 9 are multiples of smaller primes and marked false.
Explain step-by-step how the Sieve of Eratosthenes finds all primes up to a number n.
Think about marking multiples and moving through the list.
You got /6 concepts.
Why is the Sieve of Eratosthenes more efficient than checking each number individually for primality?
Consider how marking multiples saves work.
You got /5 concepts.
