Inefficient sort algorithms (2001)
richardhartersworld.com
richardhartersworld.com
http://gkoberger.github.io/stacksort/
So much worse:
https://news.ycombinator.com/item?id=8798202
http://dis.4chan.org/read/prog/1295544154/> Table search can be viewed as a special cast of the following more general problem. We are given a “maze”, i.e. an undirected graph G with n nodes, and an “entry” node u in it. Our task is to find a path from u to a specified “exit” node v, by walking on the maze one edge at a time. [...]
> However, suppose the maze is actually quite agreeable, so much so that we wouldn’t mind spending a few extra cycles in the search for v; in fact we vaguely hope, nay, decidedly wish, that the search will take as long as possible, and even though our sense of duty prevents us from giving up the search altogether, we are not that insensitive to the primeval necessities of our human nature, and besides what is wrong with taking a more relaxed attitude to the problem, as long as we do what we are supposed to do, since we have always been told that haste makes waste, and no one needs to be perfect anyway, and so forth. With these assumptions, the problem falls squarely within the domain of our theory.
The identity of the serpent is obscure. It is rumored that he is currently running a computer company in Redmond.
People get pretty riled up about sorting!
The examples were all constructed by smart people who are deliberately trying to invent slow algorithms. I don't think that a klutzy programmer would stumble upon any of them by chance.
The slowest sorting algorithm that I've seen in production was something like this:
def sort(l):
s = []
while len(l) > 0:
m = max(l)
s.append(m)
l.remove(m)
s.reverse()
return s
I looked like a hero when I reduced the main page load time for our biggest customer by 90% in one afternoon :-)