Skip to content

Commit 8d06eb2

Browse files
Added some space before and after operators
1 parent 183df68 commit 8d06eb2

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

Diff for: sorts/quick_sort.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,13 @@ def quick_sort(ARRAY):
3030
[-45, -5, -2]
3131
"""
3232
ARRAY_LENGTH=len(ARRAY)
33-
if(ARRAY_LENGTH<=1):
33+
if( ARRAY_LENGTH <= 1):
3434
return ARRAY
3535
else:
36-
PIVOT=ARRAY[0]
37-
GREATER=[element for element in ARRAY[1:] if element>PIVOT]
38-
LESSER=[element for element in ARRAY[1:] if element<=PIVOT]
39-
return quick_sort(LESSER)+[PIVOT]+quick_sort(GREATER)
36+
PIVOT = ARRAY[0]
37+
GREATER = [element for element in ARRAY[1:] if element > PIVOT]
38+
LESSER = [element for element in ARRAY[1:] if element <= PIVOT]
39+
return quick_sort(LESSER) + [PIVOT] + quick_sort(GREATER)
4040

4141

4242
if __name__ == '__main__':

0 commit comments

Comments
 (0)