模板
def quickSort(arr,left,right):
i,j=left,right
pivot=arr[left]
while i<j:
while i<j and arr[i]<pivot:
arr[j]=ar[i]
while j>i and arr[j]>pivot:
arr[i]=arr[j]
arr[i]=pivot
quickSort(arr,left,i-1)
quickSort(arr,i+1,right)
模板
def quickSort(arr,left,right):
i,j=left,right
pivot=arr[left]
while i<j:
while i<j and arr[i]<pivot:
arr[j]=ar[i]
while j>i and arr[j]>pivot:
arr[i]=arr[j]
arr[i]=pivot
quickSort(arr,left,i-1)
quickSort(arr,i+1,right)