3 ms·
Even for linked lists, which is how [] is defined in Haskell?
by quchen 13y ago
Even for linked lists, which is how [] is defined in Haskell?
- taeric 13y agoI believe the idea is that if it is not "in place," it is not quick sort.
- nandemo 13y agoThat'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-quicksort-is.html 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/html/src/Data-List.html#sort http://hackage.haskell.org/packages/archive/base/latest/doc/...