Created
February 12, 2015 07:34
-
-
Save kundzi/38c42fac630af2c1eabe 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 len(xs) < 2: return xs | |
| lq = qsort([x for x in xs[1:] if x <= xs[0]]) | |
| gt = qsort([x for x in xs[1:] if x > xs[0]]) | |
| return lq + xs[0:1] + gt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment