快速排序算法
快速排序算法python实现
defsub_sort(list,low,high):
provider=list[low]
while(low<high):
whilelow<highandlist[high]>provider:
high=high-1
list[low],list[high]=list[high],list[low]
whilelow<highandlist[low]<provider:
low=low+1
list[low],list[high]=list[high],list[low]
returnlow
defq_sort(list,low,high):
iflow<high:
index=sub_sort(list,low,high)
q_sort(list,low,index)
q_sort(list,index+1,high)
相关推荐
baike 2019-12-09
Masimaro 2020-06-21
Joymine 2020-06-06
清溪算法君老号 2020-06-01
GhostLWB 2020-04-20
田有朋 2020-04-19
sunjunior 2020-04-10
cmsmdn 2020-03-03
shenwenjie 2020-02-26
sunjunior 2020-02-15
hanyujianke 2020-01-13
路漫 2020-01-12
sunnyJam 2019-12-31
KilluaZoldyck 2019-12-15
yuanran0 2019-12-14
Happyunlimited 2019-12-10
yishujixiaoxiao 2019-12-02
YUAN 2019-11-19