0

I guess it is postoffice shorting, does anyone know the algorithm?(need a simplified version)

4
Contributors
3
Replies
4
Views
10 Years
Discussion Span
Last Post by Rashakil Fol
0

>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.

0

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.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.