|
|
|
|
|
by trealira
731 days ago
|
|
I know you're being sarcastic, but even in this linked-list quicksort, it could be made more efficient. By defining lesser and greater separately, you're traversing the list twice. You could compute them at the same time by changing those last two lines to this: where
(lesser, greater) = partition (< p) xs
I just learned about the existence of this function today, and wonder why I had never seen it used before.https://hackage.haskell.org/package/base-4.20.0.1/docs/Data-... |
|