快排的python实现
#python 2.7
def quick_sort(L):
if len(L) <= 1:
return L
else:
return quick_sort([lt for lt in L[1:] if lt<L[0]])+[L[0]]+\
quick_sort([ge for ge in L[1:] if ge>=L[0]])
#python 2.7
def quick_sort(L):
if len(L) <= 1:
return L
else:
return quick_sort([lt for lt in L[1:] if lt<L[0]])+[L[0]]+\
quick_sort([ge for ge in L[1:] if ge>=L[0]])
转载于:https://www.cnblogs.com/super-zhang-828/p/6485960.html