版本1:
http://blog.csdn.net/qq_14959801/article/details/53055485
版本2:
https://www.cnblogs.com/Jesse8/p/8110627.html
1 array = [ 9,1,22,9,31,-5,45,3,6,2,11 ] 2 def quick_sort(array,left,right): 3 if array == "": 4 return "" 5 low = left 6 high = right 7 key = array[low] 8 9 if left < right: 10 while low < high: 11 while low<high and key <= array[high]: 12 high -= 1 13 array[low] = array[high] 14 15 while low<high and key >= array[low]: 16 low += 1 17 array[high] = array[low] 18 19 array[low] = key