Added some space before and after operators

This commit is contained in:
Mehdi ALAOUI 2017-04-06 03:44:47 +01:00
parent 183df6889b
commit 8d06eb2c63

View File

@ -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__':