Skip to content

Instantly share code, notes, and snippets.

@Roasbeef
Created June 18, 2012 02:23
Show Gist options
  • Save Roasbeef/2946464 to your computer and use it in GitHub Desktop.
Save Roasbeef/2946464 to your computer and use it in GitHub Desktop.
List-comp Quicksort
def quicksort(lst):
if len(lst) == 0:
return []
else:
return quicksort([x for x in list[1:] if x < lst[0]]) + [list[0] + \
quicksort([x for x in list[1:] if x >= lst[0]])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment