mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-01-18 16:27:02 +00:00
small change!
This commit is contained in:
parent
ca7eb46756
commit
31f968f589
|
@ -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)
|
||||
print(unsorted)
|
||||
|
|
Loading…
Reference in New Issue
Block a user