#快速排序
#快速排序的优化 主要是靠基准值的设定。基准值越合理 效率越高
def qucikSort(listValue):
if len(listValue) < 2:
return listValue
else:
pivot = listValue[0] #选择基准
lessList = [i for i in listValue[1:] if i <= pivot]
greater = [i for i in listValue[1:] if i > pivot]
return qucikSort(lessList) + [pivot] + qucikSort(greater)
print(qucikSort([10,5,3,2,6]))
print(qucikSort([10,5,3,2,6,99,5,66,3,12,15,49,7,3,8,2,4869,3248,3]))