Live data from Hacker News

O(n) Sorting Algorithm: Quantum Bogosort

mathnews.uwaterloo.ca

1–10 of 19 posts

Re: O(n) Sorting Algorithm: Quantum Bogosort

#5
Some programmers on 4chan came up with a "Sleep sort" algorithm and then proceeded to optimize it, complete with example code:

http://dis.4chan.org/read/prog/1295544154

It essentially spawns a new thread for every item in the array, sleeps for an amount of time that scales with the item's value, and then prints out that item. So it's O(n + timeScale * $biggest_input)

Pretty funny / entertaining if taken lightly :P

Re: O(n) Sorting Algorithm: Quantum Bogosort

#9
post #4

I remember reading into this topic a while ago. Here is a relevant Wikipedia article. I, for one, look forward to the day when we all can have all our problems solved by destroying the universe. [] http://en.wikipedia.org/wiki/Quantum_suicide_and_immortality

Hahahaha.

Re: O(n) Sorting Algorithm: Quantum Bogosort

#10

Some programmers on 4chan came up with a "Sleep sort" algorithm and then proceeded to optimize it, complete with example code: http://dis.4chan.org/read/prog/1295544154 It essentially spawns a new thread for every item in the array, sleeps for an amount of time that scales with the item's value, and then prints out that item. So it's O(n + timeScale * $biggest_input) Pretty funny / entertaining if taken lightly :P

I wish I'd seen some of this before I took a discrete optimization course. I would have loved to submit some of this.
Post reply on HN