Skip to content

Commit 5d1ee49

Browse files
authored
Create sleepsort.py
added sleepsort.py
1 parent 3fd11fe commit 5d1ee49

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

sorts/sleepsort.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import thread
2+
from time import sleep
3+
items = []
4+
n = int(input())
5+
for i in range(0,n):
6+
a = int(input())
7+
items.append(a)
8+
def sleep_sort(i):
9+
sleep(i)
10+
print i
11+
[thread.start_new_thread(sleep_sort, (i,)) for i in items]

0 commit comments

Comments
 (0)