mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-02-25 18:38:39 +00:00
Fixed spacing
This commit is contained in:
parent
de8c5cbf00
commit
9e031e9783
@ -43,7 +43,7 @@ def heap_sort(unsorted):
|
|||||||
[-45, -5, -2]
|
[-45, -5, -2]
|
||||||
"""
|
"""
|
||||||
n=len(unsorted)
|
n=len(unsorted)
|
||||||
for i in range (n/2 - 1 , -1, -1) :
|
for i in range (n/2 - 1 , -1, -1):
|
||||||
heapify(unsorted,i,n)
|
heapify(unsorted,i,n)
|
||||||
for i in range(n - 1, -1, -1):
|
for i in range(n - 1, -1, -1):
|
||||||
unsorted[0], unsorted[i] = unsorted[i], unsorted[0]
|
unsorted[0], unsorted[i] = unsorted[i], unsorted[0]
|
||||||
@ -61,4 +61,3 @@ if __name__ == '__main__':
|
|||||||
user_input = input_function('Enter numbers separated by a comma:\n')
|
user_input = input_function('Enter numbers separated by a comma:\n')
|
||||||
unsorted = [int(item) for item in user_input.split(',')]
|
unsorted = [int(item) for item in user_input.split(',')]
|
||||||
print (heap_sort(unsorted))
|
print (heap_sort(unsorted))
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user