File tree 1 file changed +5
-5
lines changed
1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -29,13 +29,13 @@ def quick_sort(ARRAY):
29
29
>>> quick_sort([-2, -5, -45])
30
30
[-45, -5, -2]
31
31
"""
32
- ARRAY_LENGTH = len (ARRAY )
32
+ ARRAY_LENGTH = len (ARRAY )
33
33
if ( ARRAY_LENGTH <= 1 ):
34
34
return ARRAY
35
35
else :
36
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 ]
37
+ GREATER = [ element for element in ARRAY [1 :] if element > PIVOT ]
38
+ LESSER = [ element for element in ARRAY [1 :] if element <= PIVOT ]
39
39
return quick_sort (LESSER ) + [PIVOT ] + quick_sort (GREATER )
40
40
41
41
@@ -50,5 +50,5 @@ def quick_sort(ARRAY):
50
50
input_function = input
51
51
52
52
user_input = input_function ('Enter numbers separated by a comma:\n ' )
53
- unsorted = [int (item ) for item in user_input .split (',' )]
54
- print (quick_sort (unsorted ))
53
+ unsorted = [ int (item ) for item in user_input .split (',' ) ]
54
+ print ( quick_sort (unsorted ) )
You can’t perform that action at this time.
0 commit comments