Skip to content

Instantly share code, notes, and snippets.

@lucianmarin
Created February 14, 2017 16:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lucianmarin/685aa61454c60b946245ad6bffb7f55f to your computer and use it in GitHub Desktop.
Save lucianmarin/685aa61454c60b946245ad6bffb7f55f to your computer and use it in GitHub Desktop.
def qsort(list):
if list == []:
return []
pivot = list[0]
l = qsort([x for x in list[1:] if x < pivot])
u = qsort([x for x in list[1:] if x >= pivot])
return l + [pivot] + u
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment