快速排序算法分析

def quick(list,start,end):
if start>=end:
return
low = start
high = end
key = list[low]
while start<end:
while start<end and list[end]>key:
end-=1
list[start]=list[end]
while start<end and list[start]<=key:
start+=1
list[end]=list[start]
list[end] = key
quick(list,low,start-1)
quick(list,start+1,high)
posted @ 2020-04-14 23:15  taomin  阅读(163)  评论(0编辑  收藏  举报