📜  最快排序python代码示例

📅  最后修改于: 2022-03-11 14:45:54.902000             🧑  作者: Mango

代码示例1
def qsort(inlist):
    if inlist == []: 
        return []
    else:
        pivot = inlist[0]
        lesser = qsort([x for x in inlist[1:] if x < pivot])
        greater = qsort([x for x in inlist[1:] if x >= pivot])
        return lesser + [pivot] + greater