From 8d06eb2c63e5a085e530a6d41014a6dfe4f3b09b Mon Sep 17 00:00:00 2001 From: Mehdi ALAOUI Date: Thu, 6 Apr 2017 03:44:47 +0100 Subject: [PATCH] Added some space before and after operators --- sorts/quick_sort.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sorts/quick_sort.py b/sorts/quick_sort.py index c12689b9f..5153a249a 100644 --- a/sorts/quick_sort.py +++ b/sorts/quick_sort.py @@ -30,13 +30,13 @@ def quick_sort(ARRAY): [-45, -5, -2] """ ARRAY_LENGTH=len(ARRAY) - if(ARRAY_LENGTH<=1): + if( ARRAY_LENGTH <= 1): return ARRAY else: - PIVOT=ARRAY[0] - GREATER=[element for element in ARRAY[1:] if element>PIVOT] - LESSER=[element for element in ARRAY[1:] if element<=PIVOT] - return quick_sort(LESSER)+[PIVOT]+quick_sort(GREATER) + PIVOT = ARRAY[0] + GREATER = [element for element in ARRAY[1:] if element > PIVOT] + LESSER = [element for element in ARRAY[1:] if element <= PIVOT] + return quick_sort(LESSER) + [PIVOT] + quick_sort(GREATER) if __name__ == '__main__':