Created
July 23, 2014 21:05
-
-
Save jxnl/eea358fbc5d6da0ca271 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 qsort(xs): | |
| if xs == []: | |
| return xs | |
| else: | |
| fst, *rst = xs | |
| sm = qsort(list((x for x in rst if x <= fst))) | |
| lg = qsort(list((x for x in rst if x > fst))) | |
| return sm + [fst] + lg |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment