Skip to content

Commit 28ac3fd

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent bf82459 commit 28ac3fd

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

SleepSort.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,23 @@
1-
from time import sleep
21
from threading import Timer
2+
from time import sleep
3+
34

45
def sleep_sort(l):
56
res = []
7+
68
def add1(x):
79
res.append(x)
10+
811
mx = l[0]
912
for i in l:
1013
if mx < i:
1114
mx = i
1215
Timer(i, add1, [i]).start()
13-
sleep(mx+1)
16+
sleep(mx + 1)
1417
return res
1518

16-
l1 = [4,1,2,8,5]
19+
20+
l1 = [4, 1, 2, 8, 5]
1721
print("Initial Array")
1822
print(l1)
1923

0 commit comments

Comments
 (0)