Skip to content

Instantly share code, notes, and snippets.

@anaved anaved/qsort.py
Last active Dec 18, 2015

Embed
What would you like to do?
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
You can’t perform that action at this time.