Sleepsort, O(N) sorting algorithm

Friday 17 June 2011, 17:56:00 | software dev

Sleepsort O(N) sorting. Implementation in Python:

import threading, sys, time
def sorter(number):
    time.sleep(number/10.0)
    print number
for number in sys.argv[1:]:
    threading.Thread(target=sorter, args=(int(number),)).start()

^_^