defquickSort1(arr, start, end):if start >= end:return
low = start
high = end
mid = arr[start]while low < high:while low < high and arr[high]>= mid:
high -=1
arr[low]= arr[high]while low < high and arr[low]< mid:
low +=1
arr[high]= arr[low]
arr[low]= mid
quickSort(arr, start, low -1)
quickSort(arr, low +1, end)return arr
# use python .remove .appenddefquickSort2(arr):iflen(arr)>=2:
mid = arr[len(arr)//2]
left, right =[],[]
arr.remove(mid)for num in arr:if num >= mid:
right.append(num)else:
left.append(num)return quickSort2(left)+[mid]+ quickSort2(right)else:return arr
defquickSort3(arr):# shorter linesiflen(arr)<2:return arr
else:
mid = arr[0]
right =[i for i in arr[1:]if i >= mid]
left =[i for i in arr[1:]if i < mid]return quickSort3(left)+[mid]+ quickSort3(right)