Skip to content

Instantly share code, notes, and snippets.

@yucombinator
Created December 27, 2014 00:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yucombinator/1b79fdb7a31362b05c4d to your computer and use it in GitHub Desktop.
Save yucombinator/1b79fdb7a31362b05c4d to your computer and use it in GitHub Desktop.
The silliest sorting algorithm of all time.
import time
from threading import Timer
array = [10,5,2,4,1,7,65,2,8,1]
res = []
def timersort(array):
for i in array:
Timer(i/10, res.append,[i]).start()
timersort(array)
>> res
[1, 1, 2, 2, 4, 5, 7, 8, 10, 65]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment