3 ms·
What's wrong with just quicksort? Even if not, you can simplify it to prime n = notElem 0 $ map (mod n) [2..n-1] primes n = filter prime [2..n] which
by Veedrac 11y ago
What's wrong with just quicksort? Even if not, you can simplify it to
prime n = notElem 0 $ map (mod n) [2..n-1]
primes n = filter prime [2..n]
which at least doesn't pretend to be something it's not. It's also easier to optimize (take the root of `n` in `prime`).
- coolsunglasses 11y ago>What's wrong with just quicksort? The quicksort you're thinking of isn't a real quicksort and would bring on the same criticism. >Even if not, you can simplify it to Nah. I just wanted to get rid of the word sieve, not create more surface area for bikeshedding.
- Veedrac 11y ago> >What's wrong with just quicksort? > > The quicksort you're thinking of isn't a real quicksort and would bring on the same criticism. If you're saying that because it's not in-place, I'll point you to: http://en.wikipedia.org/wiki/Quicksort#Space_complexity http://en.wikipedia.org/wiki/Quicksort#Space_complexity If you're saying that for another reason, why? > Nah. I just wanted to get rid of the word sieve, not create more surface area for bikeshedding. I was pointing out something that fits your four points, which is what you asked for.
- coolsunglasses 11y agoThe not-a-quicksort you're bringing up was discussed and dismissed (for good reasons) on the mailing list.
- Veedrac 11y agoDo you have a link?
- deleted 11y ago[deleted]