Last active
March 12, 2017 15:51
-
-
Save papachristoumarios/1d7a0d849f5ac2e47f27 to your computer and use it in GitHub Desktop.
Beautiful quicksort with functional syntax
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
#quicksort with lambda | |
qsort = lambda L: L if len(L) <= 1 else qsort( [ lt for lt in L[1:] if lt < L[0] ] ) + [ L[0] ] + qsort( [ ge for ge in L[1:] if ge >= L[0] ] ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment