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 given 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 efficient for finding primes up to large n.
beginner Click to reveal answer
How does the Sieve of Eratosthenes help in real-life applications?
It quickly finds prime numbers which are useful in cryptography, hashing, and number theory problems.
What is the first prime number used in the Sieve of Eratosthenes?
✗ Incorrect
The sieve starts with 2, the smallest prime number.
When marking multiples in the sieve, from which number do we start for each prime p?
✗ Incorrect
We start marking multiples from p squared to avoid redundant marking.
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).
Which of these numbers will be marked as not prime when processing prime 3 in the sieve?
✗ Incorrect
Multiples of 3 like 6, 9, and 12 are marked as not prime.
What is the output of the sieve for n=10?
✗ Incorrect
Primes up to 10 are 2, 3, 5, and 7.
Explain how the Sieve of Eratosthenes finds all prime numbers up to a given number n.
Think about crossing out multiples step by step.
You got /4 concepts.
Describe why the Sieve of Eratosthenes is more efficient than checking each number individually for primality.
Consider how many times each number is checked.
You got /4 concepts.
