Skip to content

Create 168206219#347

Open
whaleland wants to merge 1 commit intorosickey:masterfrom
whaleland:patch-4
Open

Create 168206219#347
whaleland wants to merge 1 commit intorosickey:masterfrom
whaleland:patch-4

Conversation

@whaleland
Copy link

#快速排序

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant