Created
October 7, 2016 13:30
-
-
Save xiaq/eefcc4be1f5aa823631e8c5cf4986e97 to your computer and use it in GitHub Desktop.
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
fn quick-sort [li]{ | |
if <= (count $li) 1; then | |
put $@li | |
else | |
quick-sort [(each { if <= $0 $li[0]; then put $0; fi } $li[1:])] | |
put $li[0] | |
quick-sort [(each { if > $0 $li[0]; then put $0; fi} $li[1:])] | |
fi | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment