def quick_sort(lst):
def qsort(lst,begin,end):
if begin >= end:
return
pivot = lst[begin]
i = begin
for j in range(begin+1,end+1):
if lst[j] < pivot:
i+=1
lst[i],lst[j] = lst[j],lst[i]
lst[begin],lst[i] = lst[i],lst[begin]
qsort(lst,begin,i-1)
qsort(lst,i+1,end)
qsort(lst,begin,end)
最后
以上就是淡定银耳汤最近收集整理的关于python数据结构4: 快速排序的全部内容,更多相关python数据结构4:内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复