Skip to content

Commit 31f968f

Browse files
authored
small change!
1 parent ca7eb46 commit 31f968f

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

sorts/quick_sort_3partition.py

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
from __future__ import print_function
22

33
def quick_sort_3partition(sorting, left, right):
4-
54
if right <= left:
65
return
7-
a = left
6+
a = i = left
87
b = right
98
pivot = sorting[left]
10-
i = left
119
while i <= b:
1210
if sorting[i] < pivot:
1311
sorting[a], sorting[i] = sorting[i], sorting[a]
@@ -30,4 +28,4 @@ def quick_sort_3partition(sorting, left, right):
3028
user_input = raw_input('Enter numbers separated by a comma:\n').strip()
3129
unsorted = [ int(item) for item in user_input.split(',') ]
3230
quick_sort_3partition(unsorted,0,len(unsorted)-1)
33-
print(unsorted)
31+
print(unsorted)

0 commit comments

Comments
 (0)