Skip to content

Commit d313874

Browse files
committed
Fixed spacing
1 parent 9e031e9 commit d313874

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

sorts/heap_sort.py

+7-7
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,13 @@ def heap_sort(unsorted):
4242
>>> heap_sort([-2, -5, -45])
4343
[-45, -5, -2]
4444
"""
45-
n=len(unsorted)
46-
for i in range (n/2 - 1 , -1, -1):
47-
heapify(unsorted,i,n)
48-
for i in range(n - 1, -1, -1):
49-
unsorted[0], unsorted[i] = unsorted[i], unsorted[0]
50-
heapify(unsorted,0,i)
51-
return unsorted
45+
n=len(unsorted)
46+
for i in range (n/2 - 1 , -1, -1):
47+
heapify(unsorted,i,n)
48+
for i in range(n - 1, -1, -1):
49+
unsorted[0], unsorted[i] = unsorted[i], unsorted[0]
50+
heapify(unsorted,0,i)
51+
return unsorted
5252

5353

5454
if __name__ == '__main__':

0 commit comments

Comments
 (0)