954,092 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

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
Banned
2,230 posts since May 2006
Reputation Points: 769
Solved Threads: 128
 

You may find this article interesting

pty
Posting Pro
530 posts since Oct 2005
Reputation Points: 64
Solved Threads: 39
 

>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
Administrator
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
Team Colleague
2,658 posts since Jun 2005
Reputation Points: 1,135
Solved Threads: 176
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: