Created
December 27, 2014 00:23
-
-
Save yucombinator/1b79fdb7a31362b05c4d to your computer and use it in GitHub Desktop.
The silliest sorting algorithm of all time.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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