From 9e031e9783c63f2cbd7525e2fa35245c1dd52a8d Mon Sep 17 00:00:00 2001 From: JakeBonek Date: Tue, 16 Aug 2016 15:56:06 -0400 Subject: [PATCH] Fixed spacing --- sorts/heap_sort.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/sorts/heap_sort.py b/sorts/heap_sort.py index 6d731cd4b..7882c200f 100644 --- a/sorts/heap_sort.py +++ b/sorts/heap_sort.py @@ -42,8 +42,8 @@ def heap_sort(unsorted): >>> heap_sort([-2, -5, -45]) [-45, -5, -2] """ - n=len(unsorted) - for i in range (n/2 - 1 , -1, -1) : + n=len(unsorted) + for i in range (n/2 - 1 , -1, -1): heapify(unsorted,i,n) for i in range(n - 1, -1, -1): 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') unsorted = [int(item) for item in user_input.split(',')] print (heap_sort(unsorted)) -