Skip to content

Commit 376a60b

Browse files
Update
1 parent 105c2d3 commit 376a60b

File tree

1 file changed

+3
-10
lines changed

1 file changed

+3
-10
lines changed

Chapter11/Tim_sort.py

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ def Merge(first_sublist, second_sublist):
2929
return merged_list
3030

3131

32-
def Tim_Sort(arr,run):
32+
def Tim_Sort(arr, run):
3333
for x in range(0, len(arr), run):
34-
arr[x : x + run] = InsertionSort(arr[x : x + run])
34+
arr[x : x + run] = Insertion_Sort(arr[x : x + run])
3535
runSize = run
3636

3737
while runSize < len(arr):
@@ -44,12 +44,5 @@ def Tim_Sort(arr,run):
4444
run = 2
4545

4646

47-
Tim_Sort(arr,run)
47+
Tim_Sort(arr, run)
4848
print(arr)
49-
50-
51-
import random
52-
array = [random.randint(0, 1000) for i in range(1000)]
53-
54-
Tim_Sort(array,run)
55-
print(array)

0 commit comments

Comments
 (0)