Skip to content

Instantly share code, notes, and snippets.

@gr33ndata
Created July 27, 2013 23:56
Show Gist options
  • Save gr33ndata/6096781 to your computer and use it in GitHub Desktop.
Save gr33ndata/6096781 to your computer and use it in GitHub Desktop.
Quick Sort
def qsort(x):
if x == []:
return x
less = []
more = []
for item in x[1:]:
if item < x[0]:
less.append(item)
else:
more.append(item)
return qsort(less) + [x[0]] + qsort(more)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment