diff --git a/sorts/quick_sort_3partition.py b/sorts/quick_sort_3partition.py index 5e4e080a8..def646cdb 100644 --- a/sorts/quick_sort_3partition.py +++ b/sorts/quick_sort_3partition.py @@ -1,13 +1,11 @@ from __future__ import print_function def quick_sort_3partition(sorting, left, right): - if right <= left: return - a = left + a = i = left b = right pivot = sorting[left] - i = left while i <= b: if sorting[i] < pivot: sorting[a], sorting[i] = sorting[i], sorting[a] @@ -30,4 +28,4 @@ if __name__ == '__main__': user_input = raw_input('Enter numbers separated by a comma:\n').strip() unsorted = [ int(item) for item in user_input.split(',') ] quick_sort_3partition(unsorted,0,len(unsorted)-1) - print(unsorted) \ No newline at end of file + print(unsorted)