Created
June 18, 2012 02:23
-
-
Save Roasbeef/2946464 to your computer and use it in GitHub Desktop.
List-comp Quicksort
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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