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

I believe the idea is that if it is not "in place," it is not quick sort.


That's right. That Haskell faux-quicksort uses a lot of extra space for the temporary lists.

Here's a Haskell version of the "real" quicksort, though it isn't nearly easy a read as the faux-quicksort:

http://augustss.blogspot.jp/2007/08/quicksort-in-haskell-qui...

For what is worth, the standard Haskell sort is a variant of merge sort.

http://hackage.haskell.org/packages/archive/base/latest/doc/...




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

Search: