Zhong__python中快速排序示例

# 定義一個函數test() def test(ls): if len(ls) <= 1:return ls return test([lt for lt in ls[1:] if lt < ls[0]]) + ls[0:1] + test([gt for gt in ls[1:] if gt >= ls[0]]) a = [13,14,0, -1,-2 ,2,5] print
相關文章
相關標籤/搜索