What is the fastest sorting algorithm?
I guess it is postoffice shorting, does anyone know the algorithm?(need a simplified version)
ithelp
Nearly a Posting Maven
2,230 posts since May 2006
Reputation Points: 769
Solved Threads: 128
>need a simplified version
That's easy, there's no such thing. Be specific about the context in which the algorithm would be used and an efficient one can be suggested.
Narue
Bad Cop
15,460 posts since Sep 2004
Reputation Points: 6,464
Solved Threads: 1,401
Generally speaking, it's whichever algorithm takes the most advantage of hardware. For example, people pretend that bucket sort takes linear time, but it really takes O((n+k) log k) time, where k is the number of distinct elements. They pretend it takes linear time because for values of n and k that are less than a billion, the log(k) factor fits inside one machine code instruction. The reason quicksort is faster than heapsort is that it takes advantage of the cache. Or it's that heapsort doesn't. Similarly, you'll find that insertion sort goes much faster for sorting a deck of cards than merge sort does, but quicksort still comes out on top.
Postman's sort is available online; find it yourself.
Rashakil Fol
Super Senior Demiposter
2,658 posts since Jun 2005
Reputation Points: 1,135
Solved Threads: 176