Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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`).


>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.


> >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

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.


The not-a-quicksort you're bringing up was discussed and dismissed (for good reasons) on the mailing list.


Do you have a link?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: