4 ms·
My favorite is still slowsort. https://en.wikipedia.org/wiki/Slowsort https://en.wikipedia.org/wiki/Slowsort > It is a reluctant algorithm based on the princip
by nayuki 5y ago
My favorite is still slowsort. https://en.wikipedia.org/wiki/Slowsort https://en.wikipedia.org/wiki/Slowsort
> It is a reluctant algorithm based on the principle of multiply and surrender. It was published in 1986 by Andrei Broder and Jorge Stolfi in their paper Pessimal Algorithms and Simplexity Analysis.
https://www.mipmip.org/tidbits/pasa.pdf https://www.mipmip.org/tidbits/pasa.pdf
> The slowsort algorithm is a perfect illustration of the multiply and surrender paradigm, which is perhaps the single most important paradigm in the development of reluctant algorithms. The basic multiply and surrender strategy consists in replacing the problem at hand by two or more subproblems, each slightly simpler than the original, and continue multiplying subproblems and subsubproblems recursively in this fashion as long as possible. At some point the subproblems will all become so simple that their solution can no longer be postponed, and we will have to surrender. Experience shows that, in most cases, by the time this point is reached the total work will be substantially higher than what could have been wasted by a more direct approach.
- cratermoon 5y agoMy favorite is SleepSort https://rosettacode.org/wiki/Sorting_algorithms/Sleep_sort https://rosettacode.org/wiki/Sorting_algorithms/Sleep_sort
- robotresearcher 5y agoSleepSort is a subject of the posted article.