Skip to content

Instantly share code, notes, and snippets.

@anaved
Last active December 18, 2015 21:48
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 anaved/5849880 to your computer and use it in GitHub Desktop.
Save anaved/5849880 to your computer and use it in GitHub Desktop.
def qsort(data):
if data==[]:
return data
pivot=data[0]
less=qsort([x for x in data[1:] if x<pivot])
great=qsort([x for x in data[1:] if x>=pivot])
return less+[pivot]+great
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment