Hubbry Logo
search
logo

Slowsort

logo
Community Hub0 Subscribers
Write something...
Be the first to start a discussion here.
Be the first to start a discussion here.
See all
Slowsort

Slowsort is a sorting algorithm. It is of humorous nature and not useful. It is a reluctant algorithm based on the principle of multiply and surrender (a parody formed by taking the opposites of divide and conquer). It was published in 1984 by Andrei Broder and Jorge Stolfi in their paper "Pessimal Algorithms and Simplexity Analysis" (a parody of optimal algorithms and complexity analysis).

Slowsort is a recursive algorithm.

A pseudocode implementation is given below:

An unoptimized implementation in Haskell (purely functional) may look as follows:

The time complexity of Slowsort is given by the function . It can be found by creating a recurrence relation of the initial recursive calls (1.1) and (1.2) respectively and summing the final recursive call (2) and modelling the other operations as a constant (+1) in this case. This gives a lower asymptotic bound for , which in Landau notation is given as for any . Therefore Slowsort is not in polynomial time.

See all
User Avatar
No comments yet.