Skip to content

Commit

Permalink
Added some space before and after operators
Browse files Browse the repository at this point in the history
  • Loading branch information
alaouimehdi1995 committed Apr 6, 2017
1 parent 183df68 commit 8d06eb2
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions sorts/quick_sort.py
Original file line number Diff line number Diff line change
Expand Up @@ -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__':
Expand Down

0 comments on commit 8d06eb2

Please sign in to comment.