def quick_sort(a,low_begin,high_begin):
low = low_begin
high = high_begin
if low>=high:
return 0
temp = a[low_begin]
while low<high:
while low<high and a[high]>=temp:
high=high-1
a[low]=a[high]
while low<high and a[low]<=temp:
low=low+1
a[high]=a[low]
a[low]=temp
quick_sort(a,low_begin,low-1)
quick_sort(a,low+1,high_begin)
a=[0,1,0,1,62,89]
quick_sort(a,0,len(a)-1)
print(a)
结果:[0, 0, 1, 1, 62, 89]