def quick_sort(list_a: list) -> list:
    if len(list_a) > 0:
        first = list_a[0]
        left = quick_sort([l for l in list_a[1:] if l < first])
        right = quick_sort([l for l in list_a[1:] if l > first])
        return left + [first] + right
    else:
        return list_a


print(quick_sort([1, 2, 3, 4, 5, 6, 73, 2, 1, 23, 5]))

  

版权声明:本文为hchan原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://www.cnblogs.com/hchan/p/12931834.html