168206 icon indicating copy to clipboard operation
168206 copied to clipboard

Create 168206219

Open whaleland opened this issue 6 years ago • 0 comments

#快速排序

def quick_sort(qlist): if qlist == []: return [] else: qfirst = qlist[0] qless = quick_sort([l for l in qlist[1:] if l < qfirst]) qmore = quick_sort([m for m in qlist[1:] if m >= qfirst]) return qless + [qfirst] + qmore

qlist = quick_sort([4, 5, 6, 7, 3, 2, 6, 9, 8])

print(qlist)

whaleland avatar Jan 14 '19 16:01 whaleland