Skip to content

Commit b6e9bb9

Browse files
committed
committed from zkp
1 parent 6a7401d commit b6e9bb9

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

Introduction to algorithms/Insertion_Sort.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import random
1+
import random, time
22
class InsertionSort(object):
33
def __init__(self, nums):
44
self.nums = nums
@@ -22,9 +22,9 @@ def sort(self):
2222
return a
2323

2424
if __name__ == '__main__':
25-
x = [i for i in range(200)]
25+
start = time.time()
26+
x = [i for i in range(15000)]
2627
random.shuffle(x)
27-
print(x)
28-
print('*'*20)
29-
s = InsertionSort(x)
30-
print(s.sort())
28+
s = InsertionSort(x).sort()
29+
end = time.time()
30+
print(end - start)

0 commit comments

Comments
 (0)