4 ms·
I found this article referencing the O(n) complexity for the 'head . sort' http://apfelmus.nfshost.com/articles/quicksearch.html http://apfelmus.nfshost.com/ar
by ithkuil 16y ago
I found this article referencing the O(n) complexity for the 'head . sort'
http://apfelmus.nfshost.com/articles/quicksearch.html http://apfelmus.nfshost.com/articles/quicksearch.html
As far as I can understand from the blog and and the cited mailing lists, it works but it requires
a carefully coded sorting method, otherwise O(n log n) as expected.
- jrockway 16y agoYes, you have to pick algorithms carefully in any programming language. Haskell is a tool, not a magician.