+ 1

Describing Sieve of Eratosthenes

So, going over some of concepts in lecture. The Sieve is a list of True/False flags that help indicate the number of existing values that meet specific conditions. Would that be an accurate way of describing this? I've heard of the Prime Sieve of course, but I'm trying to help describe to myself its uses outside of that. Is it also be accurate to say that since it only iterates over the list to flip from True > False, this is the most efficient way of finding values that match the criteria? If these assumptions are incorrect, please point it out for me!

2nd Jul 2017, 3:16 PM
Sapphire
4 Answers
+ 4
Most assumptiona are Okay. Understand what it does. Take a group of numbers. (e.g. 1 to 100) Cancel out 1. Circle 2. Cross multipmes of 2 See the smallest uncrossed number. Circle it and cross out all its multiples. Repeat
3rd Jul 2017, 2:39 PM
👑 Prometheus 🇸🇬
👑 Prometheus 🇸🇬 - avatar
+ 4
Well I am not a good programmer. I bet I am younger than you and only have experience in Python from school courses. Let me try my best.
3rd Jul 2017, 3:01 PM
👑 Prometheus 🇸🇬
👑 Prometheus 🇸🇬 - avatar
+ 1
@$Vengat Nice example. Thanks! That sounds a bit like it is a type of searching algorithm. Closer to linear search, but with flags. Unless I'm a bit off here?
3rd Jul 2017, 2:58 PM
Sapphire
0
I'm not as old as you may think, age is irrelevant. I'm also a Python programmer, so no worries. lol
3rd Jul 2017, 3:12 PM
Sapphire