Skip to content

Instantly share code, notes, and snippets.

@anaved anaved/qsort2.py
Created Jun 24, 2013

Embed
What would you like to do?
def qsort2(data):
if data==[]:
return data
mid=len(data)/2
pivot=data.pop(mid)
less=qsort2(filter(lambda x:x<pivot,data))
great=qsort2(filter(lambda x:x>=pivot,data))
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.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.